Cache Active Model Records in Rails 3 and 4. Forked to pull latest code as a gem, and to add ability to short-circuit debug logging output. Also fixes warning in ruby2-0 about wrong number of arguments 0 for nil.