[MAT-387] Make some things const refs

Make things const where possible

[MAT-387] More const

[MAT-387] More const refs, simplify runtree cleanup
[MAT-387] Make more things const refs
[MAT-387] Remove comment (will be handled in another ticket
[MAT-387] Reinstate disabled checks
[MAT-387] Fix up after rebase