Applied sync incremental code from sbt 1.0.1 - greatly simplifies code.