Broke the rtdb calls out into a separate file for clarity.
Updated header files.
Staged files missed in last commit.