Move from state_machine to aasm to make Rails 4.1 happy. Fix JSON type handling in 3.2