Issue #97: Add handling of trailing slashes

I'm not sure this is the correct solution but all the tests still work as well as the ones I added. I also tested it out on a couple of applications I have. I'm a little nervous due to the logic that was already there. Please let me know if you think there is a better way to handle this.