Added function for saving data to localStorage

... plus some style improvements