Added simple event system.

Added quit button on html page which uses the new event system to close
the application.