Add loading functions and add improvements to loading/saving