More work on the parser
Merge pull request #2 from olliejohn/rewrite

More work on the parser