Implemented obligatory "type" attribute in NamedEntity ctor.

NamedEntity now requires "type" as truly obligatory field, expecting it to be set upon construction. Therefore numerous instances of its' use had to be modified.
All tests have been updated to work with new versions.