Merge pull request #14 from DrMarcII/refactor

Refactor event handling/transforming for domains.