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
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.
Preserve order in distinctBy

WorkflowBuilder now inspects the merged source workflow and if it is ordered,
attmepts to reconstruct the $sort op after grouping. This works only if the
source pipeline has one of a couple of recognized shapes.
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
Use WorkflowOp (instead of -Task) for the PhysicalPlan.

This gets us one step closer to isolating MongoDB-specifics from the
rest of the system.

It has the nice benefit of cleaning up many tests and making them a bit
more resistant to changes in `physical.mongodb`. Also, one evaluator
test (expecting failure) is now impossible to hit, since we can’t get a
badly-formed `FoldLeftOp` to the evaluator.

Fixes #366.

Also:
* add some `WorkflowOp.merge` tests;
* test `WorkflowOp.finalize` & smart constructors to make up for these
  losing coverage in the planner tests; and
* eliminate dead code from PipelineOp, since much of its work has been
  moved to WorkflowOp.
Merge pull request #377 from sellout/ready/366-plan-workflowop

Use WorkflowOp (instead of -Task) for the PhysicalPlan.
pending test for unhandled case
Note: previous commit fixes #284
Improve LIKE/regex handling.

* Move handling of LIKE patterns to the compiler,
* add a `Search` functinon that takes a regex,
* add support for Postgres’ `~` operator (alias for `Search`),
* enable escape characters for LIKE patterns (fixes #65),
* change parsing of “suffixes” to be less hacky, and
* get rid of the `NotIn` and `NotLike` Binops and std lib functions.
Merge remote-tracking branch 'upstream/master' into ready/order-preserving-distinct
Merge pull request #374 from mossprescott/ready/order-preserving-distinct

Preserve order in distinctBy
implement API for queries via GET (Fixes #350)

Make output path optional when executing queries. If not specified,
the evaluator simply leaves a result temporary collection in place.

Added a TODO on cleaning up these temporary collections.
delete temporary collection after reading results

- remove “requested output” collection param from Evaluator
- Backend now moves the temp collection to the requested location when
necessary (or deletes it)
- REPL and API (GET) both get temps cleaned up for free
- “native” (JavaScript) plan no longer has the destination of the rename