Removed unneccessary finalizeContext and document __getstate & __setstate__