(ScriptingEditor) Prevent exception about the saved tab index
Prevent NullPointerException by initializing VariableType.type to an empty
string.
Fix ClassCastException in variable detection

Calling AstNode.getString may fail with a ClassCastException
if the underlying node is not a string context, which occurs
for example when typing:
"function func("
In that case, the node is an ErrorNode, and getString fails.

Replace getString() with toSource() which never fails and produces
the same result otherwise.
Merge pull request #26 from tlecomte/leak-fixes

Fix two possible exceptions related to the autocompletion, and a tab index error