Redirect to login unless authenticated

Also added a 404 page. Please keep a close eye out for any situations in which infinite redirects occur (the URL bar will flash several times and you'll have console errors about too many digests).