Fixes #533, this fixes the urls parsing and adds a bunch of unit tests to validate different ways of passing urls