Add tests for preserve_constants factor order

Waiting on #300 before merging.