Move some common stuff from {Java|Scala}Compile into JvmCompile.