cleaning up web client JavaScript.  Separated UI specific code from data service code.  In a future commit, both the web-client and android will use the common data service interface.