Move redirect code to includes

This allows me to re-use the code elsewhere with more ease.
Move folders containing only `index.html` to pages with `permalink` value set