Implemented support for Rails 4.0

Fixed wrong unserialize call (needs the value as argument, which is weird).

Deprecation: use #to_a or #load instead of #all after where. Use #load to
eagerly load a relation, use #to_a to convert to array (which also triggers
load).