Make the Kernel similar to the Symfony kernel.

Only the request handling and the defineForkConstants are still custom
functions.