Move pk initialization logic onto `AttributeSet`

Better encapsulates its internals from `ActiveRecord::Base`.