Added a flag to mask entities with. Adds lots of possibilities to pre-process entities.