CostDistance method polished and started on Viewshed global algorithm for spark.
Something is wrong with the Graphx conversion or shortest path algorithm. Now the tests passes however.