Added support for accessing secured HDFS

This PR replaces PR #282. This PR is also related to PR #466.

Also changed the way task run so tasks always run under the user who
submit the tasks. This replaces the old approach of using a environment
variable SPARK_USER to specify the user, which is far less flexible.
This eases security management since users no longer need to open
access to HDFS files under their home directory to the user who starts
the Spark cluster.