Polynomial Phi testing now keeps track of min/max errors.

Also added code to free memory allocated for the testing. This commit
includes some other minor (white space) changes.