Refactored parsing to be simpler

In light of the changes for primary attribute support, the old way of handling
the parsing (post-tokenization) was not well built and needed a rewrite.