Cleaned up a bit so that the __index field of metatables is set only once instead of in each constructor