Add uniqueness test and --use-generated key
Merge branch 'testing'