Add a 'redirect' field in repo files

At the moment, this is just a no-op
Long lines
Minor refactoring
Move the filter functions in their own file
Implement the redirect logic
Redirection works.

Close #892
Merge pull request #912 from samoht/892

First draft for the 'redirect' feature