restrict cost_price to admin users through the api
State machine for return_items.

Fixes #5041
Show flash errors for resource controller html requests

and not for js requests.
When a resource controller failed to create/update there was no indication of what had failed.

Also adds "with_model" gem to allow easier isolated testing of `Spree::Admin::ResourceController`.

Fixes #5011
migrataion to copy current product slug values into slug history table

Closes #5046
Added a `ReturnAuthorization.return_item_tax_calculator` class attribute that is set to `Spree::ReturnAuthorizationTaxCalculator` by default.

When `ReturnAuthorization#process_refund` is called, the tax calculator is called with all return items and tax is calculated and stored on each return item and then the refund is performed with the new total.
Taxation is broken out like this to allow easy integration with third-party tax services.

Also:

- Moved some rounding further out since it was causing small but noticeable differences in refund amounts (off by 8 cents sometimes, for example).  And increase precision of some return_items fields along with that.
- Refactored return authorization controller specs so that the spec data is more correct
- Added an additional validation to #process_refund to abort the refund if we know we don't have enough funds to reimburse the customer fully

Closes #5043
Fixed deprecation config in spec_helper.rb templates (spree_cmd)

Closes #5045
If ShippingCalculator has an empty string currency, it matches to all currencies

Closes #5038
Refactor Line Item Promotion Actions & Eligibility

Extract payload to a let statement.

Refactor eligible_rules to return rules.

This is helpful to understand which rules a promotion matched at some
point later down the promotion chain.

Extract line items to adjust in to Promotion.

This is part of moving the logic out of the promotion actions in to a
place that knows a little more about the context of what should be
applied.

Add actionable? call.

Move line item actionable to promotion.

No adjustments for non-actionable items.

The logic around this has changed a little, as adjustments are no longer
created for non-eligible promotions, due to the selection on actionable.

Remove products method (no longer used)

This is deprecated, as this logic is all done internally by the product
rule and related actions.

Closes #5036
use the variant_full_price on the product show page so the correct currency settings are used. Fixes #4995
Promotion Rule: One Use Per User

This will limit a promotion from being used multiple times by a single
user.

Closes #4984
Basic promotion categories.

This allows a promotion to be assigned to a category for better
filtering.

Add ability to search by promotion category.

Manage promotion categories.

Provides CRUD for promotion categories, linked from the promotions page.

Closes #4992
Reduce unnecessary DB round-trips.

Spree::Product has after_save :touch in order to fire
the after_touch callback. But as a result, every Save updates
the product twice. There's no need to call `touch`
after a save if all you want to do is fire the after_touch
callback. So I fixed that.

I also fixed `punch_slug`, which gets called after_destroy,
so it does a single round-trip instead of about six.
After a destroy has already happened, it is unnecessary to
validate the product again, call callbacks again, touch the
product again, and fire all cascading touches again.

Closes #5049
fix failing specs with variant price
Fix typo in item_adjustments
refactor the variant price for product.js.coffee. Thanks @gmacdougall
Make sure cart adjustments partial gets rendered if there are shipments.
Update edit.html.erb
Order summary view checks if delivery step has been passed in the checkout flow before displaying any shipping charges.
Merge pull request #5056 from jschwertfeger/fix/show-cart-adjustments-if-there-are-shipments

Make sure cart adjustments partial gets rendered if there are shipments.
Merge pull request #5058 from owainlewis/master

Allow users to edit email address