Refactor REST API & weight view to use model/view classes

Make WeightView use the View class.  Separate AJAX calls into the
model module.

Update the server REST API to work on explicit objects handles on
delete.  Also return JSON for the object types that are being
modified/added, instead of the previous UI-coupled format.