Pass more things by ref-to-const

Fixes #9