Better compatibility

* ActiveSupport::Base64 was removed in ActiveSupport 4.0.0. So check strictly.
* use ActiveSupport::JSON.parse_error instead, more compat.