Continued refactoring code base and added unit tests for Element and
Domain