Move isTopLevel() to common.js.
Use safari.extension.addContentScriptFromURL() to load the youtube.js script only when required, rather than $.getScript() which wasn't working properly anyway.