Move resources into resources dir.
Add Gemfile for the webapp
Add a daemon command and refactor some functions into a separate module.
Make the daemon work.