Major commenting and refactoring of Parser, minor changes to test and codebase