added function json_encode() and JSON global constants