Check URL is vaid in demo mode and consolidate page loading code.

Fixes #53.