[SPARK-1870] Made deployment with --jars work in yarn-standalone mode.

Ported from 1.0 branch to 0.9 branch. Sent secondary jars to distributed cache of all containers and add the cached jars to classpath before executors start.

Author: DB Tsai <dbtsai@dbtsai.com>

Closes #1013 from dbtsai/branch-0.9 and squashes the following commits:

c5696f4 [DB Tsai] fix line too long
b085f10 [DB Tsai] Make sure that empty string is filtered out when we get secondary jars
3cc1085 [DB Tsai] changed from var to val
ab94aa1 [DB Tsai] Code formatting.
0956af9 [DB Tsai] Ported SPARK-1870 from 1.0 branch to 0.9 branch