Refactored Spark core to enable the Spark debugger

Breaking #224 into two separate pull requests according to @rxin's [suggestion](https://github.com/apache/incubator-spark/pull/224#issuecomment-31054799).  This PR is the 1st one that refactored Spark core to enable the Spark debugger.