API functions.
Parses an address into directory and port parts.
The last segment of the address will be checked to see if it matches a port
specification (i.e. contains a colon followed by text). This will be
returned separately from the directory parts.
If a leading / is given, that will be returned as the first directory
component. All other / characters are removed.
All leading / characters are condensed into a single leading /.
Any path components that are . will be removed, as they just point to the
previous path component. For example, '/localhost/.' will become
'/localhost'. Any path components that are .. will be removed, along with
the previous path component. If this renders the path empty, it will be
replaced with '/'.
Examples:
'localhost:30000/manager/comp0.rtc' ->
(['localhost:30000', 'manager', 'comp0.rtc'], None)
'localhost/manager/comp0.rtc:in' ->
(['localhost', 'manager', 'comp0.rtc'], 'in')
'/localhost/manager/comp0.rtc' ->
(['/', 'localhost', 'manager', 'comp0.rtc'], None)
'/localhost/manager/comp0.rtc:in' ->
(['/', 'localhost', 'manager', 'comp0.rtc'], 'in')
'manager/comp0.rtc' ->
(['manager', 'comp0.rtc'], None)
'comp0.rtc' ->
(['comp0.rtc'], None)