refactored HeapObject and ExternalObject. Replaced
replaceAllOccurrencesOfReferredObject(obj, external) with
replaceAllOccurrencesOfReferredObjectByExternal(obj)