Adds support for distinct operation.

Unfortunately I haven't been able to write tests because I have been running
into an error, I am waiting for response from the original author of this
module.