Moved some javascript

The javascript is now stored in the js/ directory and I separated the
localstorage handling functions into another javascript file.