Add aliases for old deprecated methods.
Add :allow_doctype setting.
Refactor tests and add a bunch of new ones.