Rewriting parser to be much, much cleaner