allow running the tests on python 2.5

python 2.5 doesn't have the json module, re.sub doesn't take a flags
argument.
Merge pull request #82 from schmir/fix-python25-tests

allow running the tests on python 2.5