Unify pair should be symmetric
Add tests for unify_types
Merge Siu's stuff in PR #600.