Use MemoryCursor code in framework.

That way, we need to fix bugs only once.

Change-Id: Iae3df411462b7adc12aa09a5ea7ec6f01834ac0d