add use_root and use_index

use_root is added to make it possible to select a directory
without setting the root option in the config.
use_index is added to make it optional. use_index_html and use_index_php
was also added.