[cleanup] Replace deprecated level() from EntityPointer/EntityIterator

Use method from Entity instead, cf. FS#1452.