Move database tasks to outside Rails module