Small performance improvements. Use 'python-cjson' for extra performance, if installed.