test(server): unit test more methods on server

There were some private methods, such as route()
and an anonymous request handling function
that had significant responsibility, yet were not
exposed for testing.

These methods were added to the server prototype
and some degree of useful unit tests were added
for both.