Reorder functions to remove /./ first, and support dynamicly creating path-array.