Specs for column flatten

Refactoring and specs.