Allow the event dispatcher to be injected.

PR for https://github.com/basdenooijer/solarium/issues/275