Allow flushes to behave like transforms
Add test for new flush API