dtoh, first draft

I have this basically working and want to get it out so other people can take a look. Should be usable for a decent amount of stuff already.

Associated with: http://d.puremagic.com/issues/show_bug.cgi?id=9285
see the zip I posted in the comments there for the example I was using to test