chore($parse): convert parser() and lex() to prototype-based code

I refactored most of the `$parse` code into prototypes for performance. The improvement is in extracting all the helper functions from `parser()` and `lex()` so that only one set of these is in use rather than a new one being created on each run. State is now shared via `this`.

This JSPerf case demonstrates the performance boost: http://jsperf.com/closure-vs-prototype-ngparser

- Chrome: 1.5–2x boost
- FF: slightly slower (I would love to know why)
- IE: 4x boost