Extract tests for to-sql to separate file
Flesh out to-sql.from-clause

The from-clause function can now handle complex joins, including
joins on aliased tables, aliased subselects, or even nested
join sources.