introduced a Dispatcher

attempt at implementing a `Dispatcher` inspired by the [flux pattern](https://facebook.github.io/react/docs/flux-overview.html)
btw this function was obtained from a SO question: http://stackoverflow.com/a/105074