fix behaviours of aliased SqlFunction nodes
Add HAVING support to SELECT queries. Closes #16