Object-orientated wrapper for json_encode() and json_decode() with error handling.