Refactored how the mvc and web components were instantiated to prevent global scope leaks.

Modified the authentication middleware to expose a .cookie object with cookie utils, .set, .get, and .remove