Move Expression::toElem into a visitor class