Issue410

and also some clean up (removing code that was not being used and required a lot of if's).

@josenavas, can you check if this solves the issue? Thanks!
I can get that to work but it seems slower for this case (makes sense because here there's a list comprehension that does n dict lookups, and `np.in1d`  is either using an n^2 algorithm or somehow using sets, but then it's faster to reuse the table `index` that's been built at table instantiation.