Added config module and tidied up server a bit.