Changed file structure and added rake tasks to upgrade or migrate the DB