Clean up

I'm doing some clean up to all files that need it. This mostly consists of validating the HTML and keep all files consistent.

It is still work in progress. I hope to finish it tomorrow.
Flagged and library are seperate query parameters. You don't escape them.