I liked how http://mxr.mozilla.org/comm-central/source/mail/test/mozmill/shared-modules/test-cloudfile-ubuntuone-helpers.js#82 did their response handlers, so that where's the concept came from.