Delay importing urllib2
Split session module into utils and management

Warning: this breaks the ddoc, dstate etc. imports!