improved loading and saving with pushState
also add duplicate and close support