Ensures functional tests clean up their database use

I noticed the functional tests were leaving behind a database in MongoDB. This should make sure they don't.