Refactored Session class

Ignore-this: 372b54bb24aa01a3078bf41d7e9bc7f7

darcs-hash:20090717112605-1e3d8-baa2b644687b8ba4ebdd4d22d33d24100d83f1f6