shell, base: Move hash tracking into base.

So that external components can also use it.