Feat/flags in tests

Also introduces a place to put general test helpers.