Reinstate branch 'new-count'.

This reverts commit 56f7b776c0ff2ee9bb70f96e544c33e93304f2be.

Conflicts:

	source/nds/common.h
Add a debugging menu with performance counters.