Setup event dispatacher in capsule. Closes #1177.