Wrap JSON responses inside a response object

Wrap all JSON responses inside an object that contains login
information and contains the actual response in the o.payload field.

The goal of this change is that each JSON response from the server can
contain information on whether the user is logged in.  This way the
client-side can render the UI for any given object differently
depending on login state.  Any requests to REST entry points that
actually require login (e.g. all create/modify/delete entry points)
will still error out with 403 just like before.

This should make it easier to allow some entry points to be read-only
for public viewing.

Update REST unit tests for this API change.

Also updates the client-side for the API change.

This change also changes request error handling in that we don't pass
around just Strings for error messages but use a new HttpError type
that contains both an HTTP error code and an error message.  This will
be used to signal not only bad requests but authorization errors in
case a user is trying to access another users data.
Check for JSON content-type
server: Allow making workouts publicly viewable (#9)

Add a 'public' flag to workouts that signifies its ok to view that
particular instance publicly, e.g. it can be viewed without logging in
or it's viewable by other users.

Adds a new column 'public' to the schema -- this means a DB version
upgrade will happen automatically.

Communicate the owner of 'workout' object to the client-side.  This
way it'll be possible when to render the workout UI as read-only.  The
logic should be that the UI should be read-only when the workout is
not owned by the currently logged in user.

Add a fairly detailed access control tests for the same.
Add UI controls for making workouts public
Move workout stats computation into the model
Render workouts editable only if owned by current user

Refactor WorkoutView into WorkoutView and WorkoutListView.  Most of
the actual UI logic moves into WorkoutView and WorkoutListView is
mostly used for serving the "today view" of looking at workouts for
today and for creating new ones.