`flattenObject` shouldn’t use old `MapReduceOp`.

I think this hotfix introduces our first use of `FlatMapOp`, which also
means it found bugs in `FlatMapOp`, which I fixed as well.

Also:

* added an integration test for `flattenObject` and
* fixed printing of JS `(function () { … }).foo`.