Fixed a huge amount of classes - persistence is broken again, but a few
more commits and everything should bei n working order.