More cascading changes to whole simulator

I really need to get into the habit of committing as I go in small chunks.

We're almost back to compiling. Still need to finish CPU instructions using new memory functions.