Extract `itemName` method to DRY code a little

Also added a few new test cases to cover actual persistance of the items in localstorage.