Fixes node parsing.
Refactors code.
Fixes parser::parse() to return constructed document object.
Adds more parser tests.