Refactor user API with flask blueprints, &c.

Using the blueprints and MethodView refactors the user API quite nicely.
Also, moved the expected 401 handler into this module for inclusion into
an application when the blueprint is registered.