fix saving feature. Sortable is still working after saving and pattern nodes display correctly.
reorganize js code.
Merge pull request #60 from arnaudbey/master

fix saving feature.