Extract out canonicalization

- Test it thoroughly
- Prefer Nokogiri over regexing
- Upgrade RSpec and use newer syntax


Basically a ton of work to eliminate one little annoyance I saw :trollface: