refactor, add config file, add thinky orm, clean db calls, prettier code