Split off the directory generation about issue #3

Spilt off the directory generation part from doctest,
since it is not concerned manipulation.
Small fix about coding style (issue #3)
Fix walking order (issue #3)
Fix doctest reflecting the sorting (issue #3)
Split line in docstring for limitation of line length and readability. (issue #3)
Merge branch 'node_scan' into develop