Conditionalize loading of ActiveRecord and ActionMailer support

* Only load the ActiveRecord and ActionMailer support if those
  libraries are available.