Improvements to ScriptEngine

Hello Thomas !

A few other modifications for the ScriptEngine. This aims at making it super easy to create a  plugin implemented in Python... I hope I did not make bug mistakes ;)