Rewrite database handling to use knex
Remove superfluous function