Rewritten the Controller instansiation.

Added support for Context based routing.
Cleared up trailing spaces.