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