More stable selection handling, abstracted loading/saving and added reset.