remove_duplicates_filter: address issue248
because remove_duplicates_filter used hashing into an object as its means
of comparison, it was not suitable in the general case where you want to
test equality of compound datatypes like objects. All objects got hashed
as "[object Object]".
this patch adds an optional argument to remove_duplicates_filter to allow
the user to provide a comparison function for a more generalized filter
function. when no comparison function is given, remove_duplicates_filter
works as before.