Doctype serialization refactoring. Fixed new lines rendering in <pre> tag.
Regression tests added. Version updated.