issue #280 - refactored DStreamFunctions so that it doesn not call methods 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.