Performance and logic improvements
@sammyt suggestion for reduce improved complexity on the intersection and that led me to delete removeDuplicates.
@sammyt suggested to extract the functions out of the defineProperties for readability
some polishing on tests
reduced a lot of code