Improved JSON loader and localstorage