Add a MessageEncoder factory.

Tidy up some Server code based on IDEA inspections.

Change-Id: Icdcdbecb6500fc08f24a5f8d15b36078c14e24d4
Reviewed-on: http://gerrit.dmdirc.com/3692
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>