Extract TestServer.

I will use it for more tests later.

BUG=
R=chrisha@chromium.org

Review URL: https://codereview.appspot.com/190800043