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

Opening PR for tests and comparison with other solutions for `$q` perf.

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.
I prefer the `settlePromiseFromHandler` method from Bluebird --- we save a few bytes by not re-creating these wrapped callbacks for every then().

This might be good enough for now, but you can see we're creating a lot of duplicate code here and not reusing much.