Added static constructor method and tests for DefinitionException.