Fix bin and message search, start cleaning up

* Add logging
* Fix condvar for bin and message
* Add tests for bin and messages
* Template changes
Add start of smtpd/policy server