Abstracted parser to more closely match given grammar
Improved testing
Fixed parser test