Pushed functional tests into a helper to prepare for mongo tests