Moving everything into the lib folder.

This is the initial stage of turing the Rails app into a gem
that contains one or more Rails engines.