change the dumps and loads hooks to accept string

The JSONRender and JSONParser need to be JSON serializable themselves,
so the loads_function and dumps_function are changed to accept strings
to work around it.