Fix printing of pairs, and refactor tests to use a series of expressions.