Proper handling for added, moved, trashed, restored and deleted pages.

This is mostly new stuff but some fixes to pre-existing code as well - see the individual commits to get a better grip on what's happening (still working my way towards clear commits with changes to one thing at a time...).

There's even more debug output now and all goes to site/assets/logs/messages.txt to really catch it all and compare different runs more easily. I'll clean them up at some point as this thing gets closer to being ready for production.

Just keep on merging, there's more to come :).