Re-tool half-baked virtual unit ref management. Refactoring of JSON tests