Adding a test for uniqueness and also adds options to ensureIndex