Df output dir

Split code into appropriate methods. Namely, make method for checking existence of directory and its creation.
Possibly method for conversion to canonical form. Reduce code duplicity for absolute and relative path case.