Added Spark Core compatibility

Modified library to work on Spark Core