Added checks to make sure each identifier is unique.
Code is now more verbose, but much more efficient. down from 12ms on update to 3ms, with nearly no calls to GC.