Add support for Python 2.5

- Remove `string.format` calls
- Add import for `with_statement`
- Replace dictionary comprehension with list equivalent
- Allow disabling of json (not part of the standard library for 
  Python 2.5)