Refactor make_dirs.

This should be moved once dialog for changing directories/sanity checking is
made.