Revert "Revert "Use NSURLComponents""

This reverts commit eef475254dcbe8b764b419e45559e076a519443c.
The user, password and query will already be perecent encoded