perf($q): move Deferred and Promise methods to prototypes

NOTE: Deferred doesn't get all the advantages of moving methods to the prototype,
since the constructor binds instance methods to "this" to support unbounded execution.

NOTE: This change increases the gzipped version by 100 bytes.