Support for json_encode and json_decode options

Adds support for json_encode and json_decode option parameters.
This is useful, for example, when dealing with multi-dimensional arrays and want returned encoded data entirely as an array, instead of an array of objects (default behavior with json_decode using $assoc = false).
Added test functions.