unique_by(.foo) function

As per issues #355 and #275.

I have not managed to get the docs working locally, so I was unable to test if they worked correctly. My editor has tripped on YAML indentation at times, so please verify that before merging.