Fix various issues:

- Use DI for creation to allow user-configuration of backends
- Correct some method signatures
- Fix bootstrapping issues with cookie key configuration
- Fix issues with database being operated on when not ready (such as when using testsession)
- Fix issue with cookie expiry of 0 being misinterpreted
Is this because you might get a read after a write? If so, $this->currentCookieData should be set to null if strlen($session_data) > 1024