Added testcases.
Cleaned up stop and limit order handling.