Refactoring the ``expanded`` method in the paths module.

I'm changing the ``expanded`` method to remove an unnecessary ``sort``. This ``sort`` was called on files from directories in the expanded file path. The ``sort`` shouldn't matter because the method simply returns all unique values of the expanded file path.

I've also refactored the rest of the code a little bit. In particular, I am using ``map`` instead of concatenating to an array.