Solidity const cleanup

This mainly introduces a second AST visitor that is not allowed to modify the AST nodes.
After that, it was possible to make many functions const.