Implement saving and loading config + other fixes