Refactor the daemon class

Summary:
Avoid repetitive code, by writing a class common to both MwsDaemon and
MwsDaemonLoad.

Test Plan:
make
make test

Reviewers: cprodescu

Reviewed By: cprodescu

Differential Revision: http://phab.code4fun.de/D47