further modularizes server
Merge pull request #48 from Zhang/master

further modularizes server