Add event dispatcher and update modules to work through dispatcher