Redirects fixes + unit tests

This pull request includes:
 - Temporary redirects fixes
 - A new path normalisation function for redirects
- Unit tests for embeds and redirects