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?
Will this return `[nil]` if `key_attributes` include `id` (default behaviour given by including the concern) and object doesn't `respond_to(:id)`?

If yes, is it possible to detect whether class has instance method `id`, and don't add `id` as key attribute if it doesn't? (in case user defines custom `id` method later, it's up to them to add it to `key_attributes` as well. Alternatively, should this method at least `.compact` the keys before returning them?