Various fixes to CDA script and test

Most changes (print functions, reduce) were missed when we converted to Python3.