Fixed Main stats not updating after puzzle complete

+ a host of optimisations and making code presentable, including the
creation of many functions in each View class.