Register type objects as global variables

fixes #8019