Added tentd.lib.test
Renamed test_singleusermode to test_app
Moved tentd/tests to oldtests in preperation for py.test
Basic file structure for py.test
Ignore some endpoints when loading g.entity

This is so endpoints that don't use g.entity don't 404 in single user mode.
When not in single user mode, we check that the endpoint is expecting an entity.
Provide a list of Documents that own a collection in tentd.documents
Added Entity.new(), which works like Post.new()
HTTP functions in tentd.tests

These functions take an endpoint name (and any needed kwargs), and
make a request to the application using current_app.client
Basic fixtures and tests
Ignore py.test cache
Support Content-Type in tentd.tests.HTTP
Basic logging and a clear distinction between modes
Fiddled with the test framework
Fixed test runner
Removed import that wasn't depended upon
Added better handling of application modes (--mode [single,multi,both])

* Collections are dropped after all tests that use the app fixture
* Fixtures no longer need to call drop_collections() as a finalizer
Replace global_entity fixture with a context manager in test_app.py
Added __pycache__ directories to the gitignore. They were starting to appear for me.
Move config into the app() fixture
Fix a teeny-weeny bug