Refactor define() execution
Add script sources for define() and callback function.