Two examples of using YUI3's Promise module to concatenate files.