Add support for application kernels which are not named AppKernel

Cleaner solution than #33, because it checks on implementation of the KernelInterface.

I also adjusted the tests for this and fixed some MongoDB tests which assumed the return of a cursor, when it was an array. 
Also, I improved adherence to the PHP coding standard for some lines of code.

Only changing formatting here? Any reason?