Define `before_remove_const` callback

Avoids reloading the model class when ActiveSupport clears autoloaded dependencies in development mode.

Closes #465.