Update popup.js

I added some comments and deleted old code.