pass specs, and complete the redirect function

I also did a bit of a rubocop cleanup, and got the library passing the specs that are there. as well as fixing some broken ones along the way. 

Each commit should be broken out enough that you can cherry-pick if you don't want it all.

Thanks for the hard work @ranjib