htmlmaid integration

This should work; it passes all the unit tests for the trimText() function, but I haven't actually removed trimText() yet. I'd like to have a second pair of eyeballs on this before I ditch the old trimText() implementation for good.