Create an ActiveModel::Identity mixin

This commit moves ActiveRecord::Core#== and #hash into a module in ActiveModel.  Any class can now include this mixin to have two instances be considered equal based on their `id`.

I considered making the attribute used for comparison configurable, but it seemed like a lot of complication for little gain.  Sound reasonable?
We can't assume an Active Model instance respond to `id`. It is not part of its public API. Also I don't think we should make `id` part of the required API for Active Model instances, so if we want to have a  something to compare we should use `to_key` that is part of the published API.