Performance tweak, switch to frozensets in object hashing
Performance: _apply_template discard use of has_key
Performance: Increase dict lookup efficiency