issue #280 - refactored DStreamFunctions so that it doesn not call metho...

...ds of RDDFunctions inside foreachRDD lambdas

DStreamFunctions and RDDFunctions does the same job, but now they do this independently. AbstractWrittingFunctions abstract class has been extracted as a super class for DStreamFunctions and RDDFunctions to define common attributes and methods.
This was moved to the super class