[Spark 1199][WIP] Changed wrappers to not use vals and thus avoid Path dependent types problem.

TODO: Write description. basically it fails for one particular scenario and I am enjoying tough time debugging it :)