Extract router to routes.js.
Added cookie to store pseudo authentication.