NRE in sql extractor if document closed

Fixed bug in sql extractor where if the SQL editor window was closed
after opening, an exception was thrown. Also:
1) Wired up the toggle outlining functionality (editor context menu).
2) Added support for completion on/off