Refactored javascript and added save support

Moved inline javascript into a structure.
Removed jQuery CDN denpendency
Added localstorage autosave support