Rails 4.1 compatibility

Rails 4.1 removes the `HasAndBelongsToMany` preloader, to the changes in c91640a don't work anymore. @osheroff would you take a look at it, please?

cc @grosser @pschambacher 
not sure why we are using const_defined instead of `defined?(ActiveRecord::Associations::Preloader)`