add database.xml
introduce AccountsController and move auto detection over