Implement ws_set_select_greatest/lowest()

Targets #229