Add non-member functions for mixed precision arithmetic + tests for same. Fix a couple of bugs discovered along the way.