Implemented `distinct` and `distinctUntilChanged` variants using a comparator

As @abersnaze and @benjchristensen both agreed (see the #374 discussion) that they'd like the comparator versions of these two operations, too, I implemented them here.