Fixed js bugs

Removed unecessary pandorapirate.js in root of project
Added logic to popup.js
Extended popup.js logic to pandorapirate.js