TrigValTools: Fix test failures in py2 build.
Mostly fixing iteration ordering so that things will be printed in the same order with both py2 and py3.
Mostly fixing iteration ordering so that things will be printed in the same order with both py2 and py3.