Updates !43 (merged) with some refinements I had laying around, but had never finished.
@brad.king @pboettch