Move all Firebase logic to its own DB file