Rails 4.1 compatibility

* only require HABTM if Rails < 4.1
* the ActiveRecord ConnectionSpecification Resolver has changed its initialization process
* adjust specs to no longer use previously-deprecated and now-removed finder methods
* `scoped` is no longer a valid method, use `all` to check the result instead (thanks @aprescott!)