This stuff is all super sweet. I suspect we're going to need to figure out a way to put this in a library but still be able to call it from an escript at some point. Next time we write it I think.