Added data_filter function:
   given an input stream, returns the mean or median value (depending on chosen method)