untested fix for #46

This replaces references to document.location.origin with calls to a
getOrigin() function.  But where do I put getOrigin() so that each of
the three different JS files has it in scope?  I don't know.  Probably
the definition in shell.js by itself is good enough, no?  But this puts
it into all three files: should work, but clearly the Wrong Thing.
untested fix for #46 slightly cleaned up
Merge pull request #48 from kragen/master

Fix #46.