Added suppor for __destruct and __unload (browser only)