Check for undefined module functions in JS