Implement order count. Fixes #6