adding support to create directories the chef way.

Some refactoring on the way