Defing router.js module and its dependencies.
Router module.
Adding authentication to main.js module.
Server-side authentication.