speed up query of element
There are two issues that I could find out:
- structural state should be changed in to modification residue (we need to move it from 17.0: #1660 (closed))
- filtering by included/excluded compartments should be rewritten - currently we fetch all elements on the map which is very slow on big maps