Pass JSON text into parse function

rather than as a member of the parser struct