Add support for ls -d option (closes #858)

This behaves like the UNIX ls -d.
This should solve the use case of Bug #858; ls was never intended to
work that way before. Users can now chose between the two modes (with or
without -d).
Add global "insecure" option to skip SSL validation

closes #930