define appropriate metatables for the three types of register

This is the same patch in one commit.