Generics support

Added support for Promises with generic parameters (it would probably make sense to either reintroduce a dependency on Q promises, as it once was, or to extend the interface to better support integration with Q).
Also replaced some inline types used in some methods with named interfaces to shorten the signature and to help in the usage of generics when an explicit type annotation is needed.
These changes might force some existing code to be broken by the introduction of generic versions of some types and methods, as was the case of other libraries such as knockout. Nevertheless I believe the pros far outweigh the cons.