Refactored Parser to implement generic interface.

Allows a future parser that accepts preparsed json.