Add more tests

Adds an additional test for the "redirect to trailing slash" behavior. This PR is based on #44 and most of the commits here actually originate from that PR.