Add support for compose events

- on('compose', composenode)
- on('compose:closed', composenode)

As well as some tweaks:

- api.canvas_win
- api.canvas_doc
- api.cache

Signed-off-by: Tim Smart <tim@fostle.com>