Add middleware renderer.

As more tests get added fewer calls to _app->render() can be present.
Codify the rendering process into a piece of middleware that handles it.
Convert run controller to use middleware.
Move remaining controllers to middleware rendering.
Fixing tests in PHP5.3.