Add client.type
This adds a type attribute to Client interface. Before this, we could
only differentiate the WindowClient objects from Client objects. With
the type attribute, a client can be identified as one of window,
dedicated worker, and shared worker.
Fixes #1005.