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
I don't understand why this was moved here - we end up creating an (expensive) crypto instance, just to set $this->currentCookieData, but I can't see any value to do that if the cookie isn't eventually set.