Added a method to the parser.Parser to parse from a given input stream. Refactored the pmain method in n the parser package to use it