Updated to use urlparse library [MJ-404]