Refactored parser, new test cases.