Move Badpenny logs to their own DB table

Per issue #130.  This also adds `app.db.flush_sessions()` to improve the tests, which were otherwise incorrectly passing.