for continuous:
My impression is that we should replace lj by 1, and use the original sorted series not the uniques 
for no ties: Z == Zstar
and for discrete (without tie handling) we can take the 'right' count

This would give us some speed up (minus `unique` and minus two `searchsorted`.)