use DistinctBy when synthetic projections are present
- change Proj to a sealed trait with three case classes
- compile to DistinctBy only when necessary, otherwise Distinct as before
- merge Project on left or right with source equal to the other worflowop
Convert ProjectOp and UnwindOp to map/reduce ops.

This is done via the new `WorkflowOp.finalize` function that performs
potentially-irreversible changes to the workflow prior to converting to
`WorkflowTask`. (Fixes #348)

A lot of other changes were made to support this:

* everywhere we use `Js.Expr` is now parameterized so we can specify the
  base of the expression, rather than abusing `this` all the time;
* `ExprOp`s can now _sometimes_ be converted to JS (fixing part of #272);
* map/reduce ops no longer change the WorkflowBuilder `base` to
  `ExprVar` (fixes #326);
* `FoldLeftOp` now handles patching each of its sources when necessary,
  rather than expecting the creator to do it (projecting into `value`
  for the first one, and potentially adding a ReduceOp on the others);
* `WorkflowOp.crush` tracks the `base` so it can patch operations that
  follow a `MapReduceTask` (corollary to the fix to #326), which also
  gives us some info that is useful for #287; and
* `coalesce` now simplifies some `FlatMapOp`s, eliminating ones with a
  single source and flattening nested ones when possible.

`finalize` is also a step toward #227, as that largely implies building
a `Stream` that uses different combinations of `finalize`’s
optimizations.

The one bit of nastiness (there’s always one, isn’t there?) is that I
created a `private FoldLeftOp0` that is generated by `finalize` to
indicate that the `FoldLeftOp` has already been processed. Ideally this
could be noticed in `finalize`, but my attempts were not fruitful.
Merge remote-tracking branch 'upstream/master' into ready/348-project-to-map

Conflicts:
	src/main/scala/slamdata/engine/physical/mongodb/workflowbuilder.scala
	src/main/scala/slamdata/engine/physical/mongodb/workflowop.scala
	src/test/scala/slamdata/engine/physical/mongodb/workflowbuilder.scala
Separate the two FlatMapOp composition functions.
Cleaning up.

* Eliminate unnecessary recursive calls to finalize.
* Fix a test that was affected by MapOp composition order.
* Make `finalize` a function, not a method.
* Get rid of `FoldLeftOp0`.
* Add some WorkflowOp tests for `finalize`.
Merge remote-tracking branch 'upstream/master' into ready/348-project-to-map

Conflicts:
	src/main/scala/slamdata/engine/physical/mongodb/workflowop.scala
respond to PR feedback

Remove Proj.Synthetic; instead, annotated the introduced projections with a
Synthetic annotation. Lots of ensuing fallout, resulting in slightly easier
to read composition of AST analyses.

Some minor cleanup.
go back to standard Arrow nomenclature (first, second)
Merge pull request #363 from mossprescott/ready/distinct-by

Implement DistinctBy
fix commit identification
Merge pull request #373 from mossprescott/ready/publish-script

fix commit identification
Merge remote-tracking branch 'upstream/master' into ready/348-project-to-map

Conflicts:
	src/test/scala/slamdata/engine/physical/mongodb/planner.scala
Merge pull request #368 from sellout/ready/348-project-to-map

Convert ProjectOp and UnwindOp to map/reduce ops.
Increase minimum coverage requirement.

Also get Travis to run integration tests.
Merge pull request #375 from sellout/ready/travis-improvements

Increase minimum coverage requirement.
fix jar name
Merge pull request #376 from mossprescott/hotfix/publish-correct-jar

fix jar name