Move config init, make db tasks work better