Refactored domain classes into Chaos-Domain plugin

The domain classes and their tests were refactored into the chaos-domain plugin, so they can be used in other applications and plugins.