Class system update

Moved the class system to use the new persistent storage structure. Also
made it work.