Major refactoring

Not using System.Uri but a regex to parse