Issue #7: parser stack overflow on complex query.

Added friendly message for when Sqlite3 stack is oveflowed.
Removed redundant database opening code.