Add better handling of objects in the json method, and add ability to set json_encode options
v1.0.1