Add dirname to Converter
This is a pull request by @clee704 migrated from the old project.