Add tests for oxcart.pattern

 - Write test coverage for oxcart.pattern
 - Correct the oxcart.pattern fns based on tests