Two new SQL.query commands

Added Sql.query.length and Sql.query position, also cleaned up SQL
references in Appendix.