Implement custom tags.

This is the first step towards supporting custom tags. There are
wrinkles I need to work out, since I'm not 100% sure what the finished
code will look like.
Made progress implementing the object model, including all of the built-in tags.
Added support for trimming unnecessary newlines.