initial uniqueness validation

I wrote a naive implementation of the uniqueness validation (with corresponding specs). I'm guessing this could be optimized, but it should work fine right now.