typemodel: Fix minors things

There was a static int member supposed to hold the number of possible enums... After using proper enum-entries to hold the number some more "-Wswitch" errors popped up. Added throws for the default-case. Removed an unreachable assert.

also added two older commits just to have them out of the queue without and extra merge-commit