SPARK-2269 Refactor mesos scheduler resourceOffers and add unit test

it would be better not to create a whole SparkContext here for the tests (creating a local context like this is really expensive). Instead, could this test just create a MesosSchedulerBackend directly? I think you can even just pass it `null` for the SparkContext (or you could mock one, depending on how it is used).