Move Expression::toDt into a visitor class