SQL clean-up for Issue #61: refactoring common code, adding checkEOL(), etc.
Fix #61: crash from SQL with bad DB pointer or cursor pointer
Replace keyword lookup/execute for SQL, add two SQL commands.

Remove SQL command ID constants. Add SQL_cmd Command[] array.
Remove GetSQLKeyWord(), do the lookup in executeSQL().
Add commands SQL.QUERY.LENGTH and SQL.QUERY.POSITION.