refactor to rails engine, update db config

fresh clone of repo, replaced most files with local generated engine.