Merge pull request #3 from kedz/server

Server
Improved server code, contined refactoring