Utility function for joining url components. A bit of a hack.