Clean up code, so it actually builds.
Add in type-safe routing.