Disable rtti and enable -O3 on debug.
Generalize type id generation.