Issue218

Reimplemented terribly inefficient IdentityCounter to work with constant-time performance using IdentityHashMap.