Fixed jsonify retrocompatibility. Added json_encode function as wrapper for the new implementation. Added test functions for json_encode and json security