Implement better instruction logging for the CPU

Only dump the last few instructions after an exception