Add JSON polyfill

json_encode and json_decode functions for use in PHP 5.1