JavaScript framework for creating views and communication via an event system