fixed some unit tests and some more naming

Still, there's a problem with the mongo index uniqueness. Need to check
that.