Made the equality of the TypeKey more suitable for intended use
Added tests for TypeKey