Documented the parser and made some minor refactorings.