facted out the dbinit module
handle errors and log them
call done if supplied