Remove use of json so as to support python 2.4 and 2.5