Second pass on unit testing references. Added code to support writing out of actual results and updating expected results with those files. Also no need to touch the source code if just adding test cases.