Scala termination criterion

I tried to extend the scala api by the newly introduced termination criterion for bulk iterations. Since one has neither direct access to the partial solution nor to the next partial solution one has to specify a termination function of type (previousState: DataSet[T], currentState: DataSet[T]) => DataSet[U] which is supplied with the partial and next partial solution. I hope this is flexible enough to cover many termination caluclations.

Additionally I extended the scala api by a name parameter for the write method of DataSet. It makes debugging a lot easier if one can name the data sinks properly.

I also included a small example which has however only instructional value.