Changed to background task

* Minor url tweak in bg script
* Moved logic into background script vs popup