Improve singleton and base class stuff (class.lua v0.5.2)