entitymanager: remove duplication, move refcnt && !destroyed check into helper function in preparation for caching result of that calculation scriptglue: improved timer calibration This was SVN commit r4113.