Dumb C++ level handlers, but they are good enough for now.

Also fixed bug in GDT generation.