Long overdue commit.  Overhauled entire codebase by making everything
OOP.  Client and server now work together and respond appropriately
as specified in the API.  Removed major bugs though there still may be
some minor ones left.  Introduced the idea of Global.emulated mode in the server
code to allow the server to act differently depending upon whether it is being
used for testing or real data sampling.