Added event support
 - Create event
 - Resize event
 - BeforeClose event - close can be prevented
 - AfterClose event
Minore code quality updates