Permission checking

I think we're now consistently checking permissions across the board, as well as forcing login to view all pages. Whee!

Along the way, I took a look at the folder hierarchy and decided that it's not quite as chaotic as it seemed, so we can close the issue about organizing it.