Add task to generate dump of entire database, refactoring a bit to
simplify.