Adhere to principle of least astonishment.
Adhere to principle of least astonishment.

Make classes exposed as functions do the right thing when called
incorrectly.

Currently if someone calls `api.dom.email()`, `api.dom.thread()` or
`api.dom.compose()` as functions, the function call will succeed but
the returned object will not behave as expected.

This can lead to quite a bit of confusion.

This commit helps out API-consumers by doing the right when incorrect
usage is detected.

KartikTalwar/gmail.js