Clean up JS and fix setStorage to actually work