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?
If `to_key` is used, it seems even more sense to also move here the comparison method `<=>` from `Core` which uses `to_key`:

https://github.com/afeld/rails/blob/identity/activerecord/lib/active_record/core.rb#L375