Fix tests and add tests for new sql logger

Fix  tests where it was easy, and skip the harder one. When adding the test/bootstrap.php I needed to duplicate a bunch of code from the core tests whic was a bit unfortunate. Perhaps CakePHP can have a bootstrap helper for plugins?
Not the actual version, I guess