Preserving folder structure when using glob patterns

The pull request is related to #46.