Cleanup order model

This change is dependent upon pull request #23 and includes needed code.