Removed some duplicate code in the parser + other minor cleanups

The main change was adding an 'optional' param to parseGroup removing the need for parseOptionalGroup.  There are some other minor changes which I'll comment below.
Removes the need for the if/else block starting on line 521 in Parser.js.