Updated Rails 3.x appraisals, added 4.0

Using test_after_commit gem instead of patch. The patch was no longer working
in Rails 4.0.
Removed explicit primary key definition
Added @JohnMorales' fix for running specs
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).