Fix errors and warnings with specs on rails 4.0

This addresses problems I had running the tests against rails 4.0. There are still deprecation warnings for e.g. `scoped` --> `all`, which should be addressed later in a compatibility-breaking release.