removed useless OR condition from _as_tree()
added test coverate for list_dir( ... => { recurse, as_tree => 1 } )