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`.