Fix #35 typo and #30 add onOpen and onClose callbacks.

Useful for additional styling or un/binding events. Borrowed technique from #17.