Call create_tables() correctly

create_tables() is no longer in AuthenticationContext, but in the root
level of auth
Rename server.py to api.py
Move WSGI initialization into server.py

Move the initialization and DispatcherMiddleware code into server.py,
so we can just import the application from kb_api.server into either
the .wsgi file, or debug.py for debugging.
add user management
Update authdb.py to use request contexts

Update authdb.py to use Flask test_request_context() to create the
tables and access the database.
Remove the /setup route

Since authdb.py works again, and /setup was clunky anyway, remove it
Update debug.py for SSL

Update debug.py for SSL support and client certs
Update config.py to read from the environment

Rather than hardcoding preferred paths to the config files, pull the
value from the environment.
Fix logging in init.py

Do not call logging.basicConfig in init.py, instead add a NullHandler.
Do not add a handler on stderr if we can't log to a file
Change update_db_object to make fields optional

To streamline things, update_db_object() will now update
all fields listed in kwargs, unless an optional list/tuple
of fields is provided, in which case only those are updated.

This whole thing is possibly not needed with Flask-SQLAlchemy
Switch to Flask blueprints

Rather than two separate apps with a DispatcherMiddleware,
switch to Blueprints.

- Convert app in admin.py to a blueprint.  Change the error handler
  to an app errorhandler, and the template_filters to app_template_filters
- Update the endpoint names in url_for with a leading '.' to indicate
  they're relative to the current blueprint
- Convert app in api.py into a blueprint
- No longer import the database into api.py, it's not needed.

- Drop the prefix code in api.py, because we now mount the blueprint
  wherever we want
Move app code into __init__.py

- Move the application initialization and blueprint mounting into
  __init__.py and get rid of server.py
- Update the .wsgi to include the new import location for the app
- Update debug.py with the new import location
SSL/cert handling fixes for debug.py

- Prevent debug.py from verifying the cert once and then applying to
  all subsequent connections byt switching to threaded and resetting
  the session id
Update error handling in api.py

Rather than mucking with handle_error, override error_router and
determine whose error handler to invoke based on the prefix the
blueprint is mounted at.  This will allows flask-restful's API handler
to be invoked for 404s inside the API, which will pass the CORS headers.
Move the template directory to the module

- Don't put the template location in the config file, move it to the
  module.
- Update the templates to include the blueprint prefix in url_for()
Move resources to new 'static' directory

Move the 'resources' directory to the new 'static' directory
associated with the static blueprint in __init__.py

Update the links to static resources in the CSS and the page templates
Add an error template and update error handling

In the admin interface, add an error template, and upate the 500
handler to use it.  No longer raise HTTPExceptions, instead raise our
own exceptions when something goes wrong.  This allows us to get rid
of the 403 fixup hack for Safari, and will just plain be more robust.
Refactor api.py, add self-documenting

- Some general cleanup: remove the uneeded "abort" import
- define the blueprint name at the top, and override add_resource so
  that the class itself can provide its urls and an optional endpoint
  name
- Add a "Docs" class to document the API by parsing the class docstrings
- Define the blueprint name at the top so we can use it in the
  docstring to determine which rules we own.  (There's probably a
  better way)
Only print remote_user if defined

In the page header template, only print remote_user if it's defined.
Automatically approve keys