Use -[NSString pathComponents] to deal with leading and trailing slashes.
Merge pull request #20 from Coneko/use-pathcomponents

Use -[NSString pathComponents] to deal with leading and trailing slashes.