Created header to easily make new daemons.

This commit extracts stuff from the receiver_daemon.cc file
into a header which should make it easier to create daemons
for other datastore types.