tests: add basic test framework and runner script

Also add nose to requirements
manage: add setup command
manage.setup: add --clean option

Add clear_database to model. This is useful if you want to run
the command more than once.
_help.mongo_to_dict: allow not all fields on an object to be set
api: add POST to /admin to support creating admin user
doc/Security.md: add basic documentation of proposed security model
Require email argument in manage.py setup task
Don't try to recreate the admin role in manage.py setup task
Clean up and document manage.py setup task
Allow overriding database name with DBNAME environment variable
Override DBNAME in run_tests.sh script
Don't run tests against live site, use app.test_client instead
Properly deal with the case where the admin role already exists in manage.py setup
Properly deal with the case where user with given email address already exists in manage.py setup
Make Travis start MongoDB and run nosetests
PEP8ify imports
api: use a flask Blueprint rather than adding to the app directly

This is a more flexible way of specifying the routing, see
http://flask.pocoo.org/docs/blueprints/ for more
api: get a logger from logging rather than using app logging
api: move Flask-Security setup to __init__ rather than in api
Remove circular import