Don't call 'remove' function while iterating over the std:list.
Remove unsafe interface functions from list wrapper classes.

Improve const correctness of IR classes:

  • remove 'const' qualifier from methods that violate logical const-ness
  • add const methods where they are necessary

Avoid undefined behaviour in UseItem class:

  • replace raw union with std::variant to avoid UB
  • refactor some methods