Refactored parser, and changed internal representation.