Update main.js for more efficient url handling

Strips www.
Resubmission of previous commit
Merge pull request #22 from akkatracker/patch-4

Update main.js for more efficient url handling