Bugfix/qi tests

This fixes all of the unit tests for qi, and has some additional cleanup. Combined with the boost::phoenix patch, all of the qi and qi_regression tests compile and pass.