Refactor action event dispatching
Make jsdom optional...