added mem-ctrl, caches, and the main program loop.