implemented FunctionalStream.sort and FunctionalStream.sortBy methods