Now removing the global script states when the context is destroyed.
The previous commit takes care of this FIXME.
Removed the old Marshal methods.