Refactored Core Order Checkout

Removed temp variables

Added tests to (remove|find)_transition

Added defensive programming approach into find_transition

Fixes #3630