Cleaned up some debugging stuff.
Redid interrupt handler to read imr/isr once and to write the imr once.