BUG: Fix handling of STOP, LIMIT and STOP LIMIT Orders

Includes specific handling of Buy Stop, Sell Stop, Buy Limit, Sell
Limit, Buy Stop Limit and Sell Stop Limit orders.
TST: Updates tests to fit fixed stop behavior.

Change the answers to the stop order tests to match the corrected
behavior, where results are opposite from previous behavior.
MAINT: Use bitwise flags to help order cases easier to follow.

Instead of nesting order direction and related stop and limit logic,
derive a bitwise mask from the combination of order configurations
and use the mask as a 'switch'.
Merge fix for stop orders.

Pull in patch that fixes the stop orders so they behave correctly
with regard to the price being greater or less than the stop for both
buys and sells.

Also, update unit test and add a refactoring on top of the fix to
make each sell/buy, stop and limit combination more clear.