Fix back navigation

When the user arrives at '/', we want to change it to '/#HEAD', but we
should replace the state instead of redirecting, which breaks back
navigation (the user would go back to '/' which would redirect again).

This fixes #8.