Added ready and closed events.

Closed #4.