some refactoring and first fixes to allow other scripting languages in IDE