Adds user authentication with Devise + several bug fixes and
code refactory.