Introduced new parseDirectory function.

Introduced recursive function to parse a given root directory so the reproduction
will be easier.