add FlattenContinue state, add manual commit, cleanup logging, cleanup test