enable function to return an object with curPath being returned

Usable by grunt-contrib-handlebars

See [grunt-contrib-handlebars#107](https://github.com/gruntjs/grunt-contrib-handlebars/issues/107)