Allow recreating deleted stock items

Add deleted_at to uniqueness scope otherwise use cant recreate a stock
item on the same stock location

Fixes #3834
Prefs: don't determine persist? from .connected?

.connected? returns false until a connection is actually attempted. This
meant if the cache was empty, preferences would be set to their default
values and that would be persisted to cache.

This reverts commit 9ca8ef97fb9139a5aecd1f406b21a7fadfdca658.

Fixes #3785
prefs: don't cache fallback when not persisting

When persistence was disabled (for whatever reason), fallback values
were written to the cache if there was no existing value cached.

There is no benefit in doing this. Database lookups will not happen
without persistence being enabled, and there was potential for the
fallback values being incorrectly written to the cache.
Create a custom router mapper so we have more control over the routes

Due to reasons explained in rails/rails#12367
Provide add_routes and append_routes methods

add_routes for when you don't care where they go (as long as they're there) and append_routes for when they must absolutely go at the end of the routes
verify if a user can fire a following event on order or not

Fixes #3818
Add class name to Variant#option_values association

This is so something like this would work:

variant.option_values << ov
Reload rules select2 box after picking a PromotionRule

So that the chosen rule no longer is displayed on the select2 box, users
can associate each rule only once with the promotion

Fixes #3572
Fixes #3816
Don't convert list of stock items to an array if all we need to do is sum
Fix redirect loop with redirect_https_to_http

force_non_ssl_redirect was testing if the actions was included in
ssl_{required,allowed}_actions, but didn't consider the case that it was
empty (which should mean all actions). This caused an infinite redirect
loop on admin and checkout pages with the option enabled.

This fixes the issue and simplifies the code by combining the lists of
allowed and required ssl actions. Also added some specs.

Fixes #3813
changed to use display_price whenever possible to allow extension and to simplify code

Fixes #3822
Must set calculable before saving new calculator in MigrateOldShippingCalculators migration, otherwise MySQL screams
Use Spree.url() to add tokens to API calls to stock_locations

On 2.0, stock_locations AJAX class are getting a 401 on http://localhost:3000/admin/stock_transfers/new since securing the stock locations API end points.

Fixes #3828
Set stock_item count_on_hand and use that in variant#in_stock? test
remove unnecessary routes block in c_h/ssl_spec

rails 4 doesn't rely on routes for it's force_ssl
Fix admin menu spacing

admin menu spans all width and centers items since we removed horizontalNav.js from the backend we need a way to replicate the previous behavior display: table; on the parent <ul> and using display: table-cell; on chil <li> ensures we always use the whole width of the parent container and we span the children <li> accordingly using the same width across the given space

Fixes #3839

Conflicts:
	backend/app/views/spree/layouts/admin.html.erb
Ensure that routes are not drawn more than once from core/routes.rb
Make sure users can set price via api
Use I18n for variants on product creation prototype listing

Fixes #3844
Give us a chance to skip adjustments on order import via api

Since adjustments is tightly coupled with line items creation we can
only do that by destroying tax adjustment after line items are created.