Refactored SimpleServer to make its run method testable.