Adding save/load functionality, plus other changes