Add debug output to setTextOfElement.

Check return value of getElementById and in case of missing id log a message to console.
Remove obsolete code which generated JS errors on console.
It is not necessary to update the text of an element in cases where the Ajax function will return a whole new parent HTML snippet.

Fixes #47
Made variable type explicit to help IDE type analysis in GSPs.