Add code to detect when causality has been violated

(state changes occuring before inputs that should have been the other way
around)