Finally got it hammered into shape. http://gist.github.com/140507
Enjoy. Incidentally, I released it under MIT because I've read some things lately that have turned me off Public Domain dedications; specifically that if you public domain something, that potentially leaves an avenue for people to sue you if the code contains bugs and that some countries don't actually allow for public domain dedications at all. MIT was the least restrictive common license I could find, so I think I'll just stick to that from now on for stuff like this. That said, if anyone wants to incorporate this into a larger library and needs to apply a different license, let me know.