Feature/fix script object cache usage

instead of clearing the whole cache once one context is deleted use the per-context cache so that when one context is deleted it clears the cache automatically but doesn't affect other contexts