Splitting up the payload hash creation a bit to avoid ternaries everywhere
Adding specs, and locking support to Rails 3.1 and above