Dynamic moduleName from function

Added ability to determine a dynamic module name by allowing the
config.moduleName to accept a function (which takes the current file
object) which can return the moduleName as a string