Fixes to proxy handling with config load/save and xnatPass login

Please note that pull request https://github.com/pyxnat/pyxnat/pull/46 by @fedorov is a subset of the changes suggested here. This is proposed to fix problems discussed in https://groups.google.com/forum/#!topic/xnat_discussion/bz4wAmtmDZA
Fixes: 
Line 164 KeyError logging in using .xnatPass

Line 288 Fixes logic causing "AttributeError: 'NoneType' object has no attribute 'PROXY_TYPE_HTTP' " if socks is not set but proxy is set to something containing a username

Line 529 added code to save proxy to config file, if it is set

Line 569 Proxy set to cachedir instead of proxy when reading config file

Saves proxy 

Outstanding issues:
no way to read or write proxy info to/from .xnatPass file
if socks is None because no socks package is installed, user isn't informed that the proxy can't be set up