More type safe implementation of BType, cleanups in GenBCode

More type safe `BType` implementation. Various cleanups in the `GenBCode` backend. Also some cleanups and clarifications in `Names`. More details in the individual commit messages.