list dir contents function handles empty dir --

I have added code and tests to the list directory contents function to portably
handle empty directories by distinguishing between a glob returning "*" for an
empty directory and a directory that just contains a file named "*".

I have also improved the documentation and fixed some minor typos in the
existing list dir contents test.
Rationalising list dir cont test script --

...so, I want to make a commit in case I need to reverse out of any changes!
Added permission tests to list dir cont test --