Added some documentation and cleaned up the code for the Parser.