move the db connection logic into logs

this allows us to add reaping_frequency to the AR config (http://edgeapi.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html)