Port bbf9e25586b07c7e87b98218b8bd62cb5eefd33c without ApplicationMaster.Scala & SparkBuild.scala changes

Conflicts:
	bin/spark-shell.cmd
	bin/spark-submit.cmd
	core/src/main/scala/org/apache/spark/SparkContext.scala