Added .flatten method to Operation.

Fixes #223