Added test framework

Only 2 tests added, but the basic handling of the flask app creation and database clearing is there.

Also randomizes the test order to prevent issues where tests depend on each other.

Simple run py.test to run the tests. 

We could maybe change it to use a sqlite memory database instead of a file, it might speed up the tests if they are discovered to be slow.