Put server to a library. Add tests for "user" data structure