Adding support for working with directories

This fixes issue #123 and adds support for (recursively) working with directories of files. See the original ticket for an example of the intended behavior.

If this looks ok, I can update any relevant docs before having this merged.