Move znorder to XS; add tests for znprimroot