syntax check fix

The IOException had a bug  PlexException --> plx::Exception in the ctor.

This was found by the syntax check suite.
adding #if 0 handling

primitive but seems to work.
entity processing order refined

by type or if equal then by lexicographical order of name.

All tests pass.