test(urlUtils): Add tests for urlUtils

I also broke up some methods in urlUtils to make it easier to test