Fixed array-references.js required A LOT of changes

To fix array-reference.js unit test it required completely decoupling
id/class so that obj_getAssociatedObject/obj_setAssociatedObject would
not leak memory.  This is now fixed, sorry for the large commit.  Also,
moved “core” unit tests into an archive, the inner (private) api for
core has changed, unsure if its necessary to keep these in sync.