Added templated EventHandler and EventQueue classes to handle events of any type.