Allow deployment into subdirectory

This is a little hacky -- really, it'd make sense to pass the base path into the javascript rather than stuffing it into a global, but this got the job done.