3.0 phpunit

This is my humble approach to not using the test shell for running core tests. I had several goals in mind

- Not depend on any App folder configuration
- Not mess with phpunit internals by overriding classes
- Be able to just type `phpunit` to run all test so that we can add groups later
- Have a clean way to pass env variables and use them in the phpunit init script

I also made some broken tests pass during the process. There might be some problems with sqlite and postgres, but they are due to unimplemented/broken features in the database layer.