Major refactor.  No testing yet.  Also, code for hitting the server
isn't there yet.