Improve expr-to-sql for equality maps

This change rewrites an equality map as a logical AND expression
and generates it, thus allowing for parentheses if needed.