support python 2.5 for client

add support for with statement and use simplejson if python version is
2.5