Fixed permalinks

This should fix the page permalink issue. I tested it as much as I could but it could most definitely use more.

There's an odd quirk, even on a clean install of WordPress, where the direct page parent doesn't show up unless published or you explicitly modify the permalink, not sure what that's about.

Sorry about all the rando commits, somehow I had touched the notifications file when I was committing this. Took me a while how to figure that one out...

Still working on figuring out a better way to solve the permalinks problem in general. Gonna try and cut down on the number of hacks needed.