move server tests to separate file, add daemonization support, and svr tests