Rewrote has_type so that it no longer needs a heap and sync state.