Bugfixes and code cleanup.

- Bugfixes and code cleanup.
- Added variant to /motd to allow setting temporary MOTD (until server restarts)