Improved ScriptCache

It should be initialised only once in its lifetime