Expand the Entity class with levels

The Entity class now has a level as uint8_t.
0 means background and 255 means foreground.
The operators > and < compare the levels.
Improve the isValid() function.