Add documentation and refactored parser impl