Move logic from viewer.js to chromecom.js

and also default to '' instead of DEFAULT_URL to avoid trying to
load a non-existent file when no file has been specified.