Added check that the user isn't trying to store a function (which jquery.localStorage can't de-searialise)