bunch of parser library improvements & refactorings.