Preliminary support for building and testing with Java 8

A few straightforward fixes of problems that arise when we try to build and test master with Java 8.

There are more test failures that are Java 8-specific but we need a release of partest that includes scala/scala-partest#14 first.