Start new error handling, segment tests
Refactor Element::encode into a bunch of methods
Add and test datatype parsers