`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`.
Merge pull request #338 from sellout/ready/hotfix-bad-MapReduceOp

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