Manual implementation of intersection D3 sets, as the `intersection` function from underscore was too slow.