Make the extension template's default rake task run the test_app rake task if necessary

Fixes #4396
Tidy up with_property and with_property_value scope code
don't access Spree::Config[:site_url] at startup

Fixes #4421
Fix duplication of spree option values when product is cloned

Fixes #4420
Fixes #4417
[api] Attempt authorization for an order if an order token is passed

This stops the 'You must specify an API key' error message from (incorrectly) appearing. That message is now supressed if an order token is passed in.

When an order token is passed, the authorize_for_order filter is called, which attempts to find an order and then compares the order's token with the order token from params/headers
Remove typecasting from Spree::Preference

* Remove typecasting from Spree::Preference

Value is always serialized (even strings) as of 2723636. Since value is
converted upon assignment, I believe it had no effect.

* Remove Spree::Preference.value_type

Now unused since typecasting on Spree::Preference removed. There is no
need to store this (values are already serialized in the correct type).

Also removes the .valid scope on Spree::Preference. All
Spree::Preferences should be valid because they have passed migrations.

* don't pass type into preference store
* remove Spree::Preference.raw_value
Refactor Preferable#preferences

Extracts finding preference names into Preferable#defined_preferences.
And searches methods for preferred_*=, as I intend to remove
.prefers_*?.
Remove unused preference methods

This removes several methods which were never used.

* remove prefers_color?, prefers_color=
* remove prefers(:color)
* remove preferred(:color)
* remove preference_description(:color)
* remove preferred_color_description
* remove remove_preference
Preferences::Store quacks like a Hash

Preferences::Store#get (now aliased as #fetch) now behaves similarly to
Hash#fetch or Rails.cache.fetch. That is, in the event of a miss (the
preference is not yet defined), a block will be yielded and the result
of the block cached and returned.

This allows the defaults of preferences to be defined as a proc.
Don't access Spree::Config[:currency] at startup
access preferences via Preferences::ScopedStore

Objects including Preferable now always access preferences in the same
way through #preference_store, which returns an object responding to
fetch, []=, delete. This moves the responsibility of storage method
out of the object itself

ScopedStore is a proxy to the underlying cache store which adds a prefix
and suffix to the keys.
Adjust specs to save after changing preferables

Fix creation of adjustment
add a spec for deeply nested junk
add inverse_of to CalculatedAdjustments#calculator
switch to serializing preferences on records

remove now unused preference methods

* remove save_pending_preferences
* remove rails_cache_id

switch preferences to ActiveSupport::Concern

Prefereable#default_preferences

s/preference_store/preferences/g

merge defaults with existing preferences on initialize

fix for autosave: true not working with serialized
Migrate preferences onto serialized column
write about preference changes in the CHANGELOG