Iss244

fixes #243 and fixes #244
Created new url_path_join function that handles slashes in urls more gracefully. 
You don't seem to ever use default as an argument, so why not simply get rid of it and use a local variable.

Can we rename this to something more suggestive: get_first_token maybe or something similar?