shell, base: Move cockpit.hash into base.
base: API for hash tracking and setting.
shell: Use new API for hash tracking and setting.