Added support for functions in commandsjs