Replaced localstorage with cookies

Added jquery cookie support and formatted the code on all pages