Add Rails 4.0 travis tests.
For Rails 4, fix deprecated calls to scoped, which should be either scope (in associationproxy) or all (in relation).