Update main.js

Encapsulated storageChanged.