Made some internal changes to the parser and added some docs to it.