Close GH-66: Add support for directories. Fixes #47