moved out server code to separate module
added server tests (exciting!)