Correct several notices and remove extra unused bits
I thought the ternary operator is fun
Reorganize index.php a bit
Rewrite lib/templates/redlinks.php
Remove unused code
Remove warning