It has some really good drag and drop, and for the hiding and showing you could use style.display = "none" or "block";. I'm currently working on a page that implements all of that, but its at about 5000 lines of code right now, so I'm not even going to try to post that.
My code never has bugs. Just unintentional features.
To save state, get any cookie set of functions (such as a jQuery plugin, or just a group of functions), and set a cookie to store state, every time the layout is changed. Then when the page is opened, read the cookie, and lay out the page appropriately.