I am considering preparing this code for a more general release. At this point the code is completely subject to change and not yet ready for general use.
With that caveat, a variant of this code has worked for me in a production environment, and anyone is free to fork this repo to use as a starting place.