Upgrade to rails 4 and sqlite

Opening pull request into `migrate-to-sql` branch so I can better work with the changes RE the data migration from mongo to sqlite.