Moved route-related fns to their own namespace.
Added some documentation.
Added placeholder for the middleware handler.