Added state saving, deletion, clear all magnets and magnet reset