Improved the SessionHandler so that it takes better care of its pointers. Also changed it so that the LoginParams is copied in meaning a local copy is taken and therefore always available. It had been going out of scope in places as a reference which was causing some problems with the tests which were changed to use a singleton connection manager