Add index to spree_orders for user_id & created_by_id

Addresses potential performance regressions discussed at #4582 in the last_incomplete_spree_order method arising after that method changed in c455e1a

Fixes #4584
Deprecates the Order#between method for created_between and completed_between

Addresses the discussion in https://github.com/spree/spree/issues/4554

Fixes #4597
[order importer] Set shipping rate to be the selected shipping rate

Conflicts:
	api/spec/models/spree/order_spec.rb
More robust namespace adjusting

As discussed in https://github.com/spree/spree/issues/4479, the existing migration would generate inaccurate class names due to the fact that `demodularize` will only select the very last part of the class name.

So, for instance,

`Spree::Calculator::Fedex::Ground` would be changed to
`Spree::Calculator::Shipping::Ground`, which would trigger an `uninitialized constant` exception. The desired new class name is
`Spree::Calculator::Shipping::Fedex::Ground`, and this suggested PR will handle those class name changes more appropriately.

Fixes #4520
Spree::Variant.deleted? returns Boolean

This change brings the `Variant` behavior in line with the `Product` behavior:

https://github.com/spree/spree/blob/master/core/app/models/spree/product.rb#L134

Fixes #4497
Speed up admin/shipping_methods with includes()

Loading the zones and calculators with an `includes()` call seems to noticeably speed up the loading of this page and dramatically reduces the page's requests to the db.

Fixes #4534
Add Payment#cancel!

This is now called when an order is cancelled, and can do one of two things:

1) It will call the payment method's cancel method if it has one (BraintreeGateway is so far the only gateway to have one)
2) It will call credit! and act like cancelling an order used to

This is part two of the fix for spree/spree_gateway#145
Fix issue with stock movement routes.

The standard stock movement route depends upon stock_location being
specified. The StockMovementsController depends on a stock_location_id
being specified, so the correct stock movement route is the one nested
under stock location.

Using the non-nested route leads to an error "Couldn't find
Spree::StockLocation without an ID".

Fixes #4631
Always redirect to the payments screen after creating a new payment

Fixes #4628
Load a StockItem's variant, even if it's been soft deleted

Alternative patch for #4652

Fixes #4651
Fixes #4652
Use correct path in new_order_spec

related to #4628
[frontend] Load taxon if params[:taxon] exists in ProductsController

Fixes a small bug where searching *twice* for the same term results in the taxon 'scope' being forgotten
Speed up admin/shipping_methods/_form with local var

I saw [almost 200](http://en.wikipedia.org/wiki/List_of_sovereign_states) calls  to `Spree::Zone Exists (0.3ms)` and thought there must be a better way.

Here we put the `@shipping_method.zones` into a local variable so we can hit that instead of the db.

Notes:

* The `to_a` method is necessary to force Rails to evaluate the `zones` scope. Otherwise we still get hundreds of db calls.
* If we want to, we could always replace the array of `Zones` with an array of `ids` -- replacing `to_a` with `.pluck(:id)` and having the checkbox tag read `include?(zone.id)` instead of `include?(zone)`. However I'm not sure this additional change is necessary.

Fixes #4535
No longer use insufficient_stock_lines in view

Fixes #4665
Fixes #4664
No longer caching insufficient_stock_lines

Fixes #4664
Fixes #4666
Stock::Quantifier must take a variant, not an id

@brchristian pointed out that the previous resolve_variant_id logic was
broken when a variant had been deleted.

This removes the resolve_variant_id private method from Quantifier, and
reuqires that a variant object be passed in. Finding associated variants
should be the resposibility of the caller, and the code to load a
variant unscoped need not be here.

Fixes #4660
Bump to 2.0.11
Bump to 2.0.12.beta
Add data-hooks to admin/products/new and admin/products/_form

Similar to https://github.com/spree/spree/pull/4521, this commit adds data-hooks that make manipulation of the admin/products/new page considerably easier, cleaner, and more succinct.

Fixes #4682 and #4683
Use permalink rather than slug in 2-1 and 2-0

My PR https://github.com/spree/spree/pull/4683 to `master` and `2-2-stable` turned out not to be backwards compatible with `2-1-stable` and `2-0-stable` due to the shift in nomenclature from `:permalink` to `:slug` that happened between 2.1 and 2.2.

This PR patches this and restores functionality to `2-1-stable` and `2-0-stable`.