Modify 362769d slightly to still expose core methods.

Having these methods visible even when server.py is not the main script will make it possible to unit test them.