the js dispatch pattern applied

Minimal js dispatch setup for first js/coffeescript development. @mkasztelnik I guess this is more or less what you meant.