interrupts: modify handling of interrupt state

Interrupt state edge detection and wait states combined into multi
	function variable, enabling the removal of edge detection
	code in the run loop and simplifying need to service interrupts
	by placing the burden on code directly influencing the interrupt
	handling state.

modified:   simavr/sim/sim_avr.c
	edge detection code removed from both run loops.
	raw (non-gdb) loop does precheck of interrupt state, while not
	necessary, potentially saving a few cycles.

modified:   simavr/sim/sim_avr.h
	uint8_t i_shadow changed to int8_t interrupt_state.

modified:   simavr/sim/sim_core.c
	flag changes which may impact interrupt state are routed
		through avr_sreg_set().
	multi-cycle loop simplified to check avr->interrupt_state.

modified:   simavr/sim/sim_core.h
	static inline avr_sreg_set() - handles changes to global
		interrupt state and ensures wait states if I
		flag changes from 0 -> 1.  superfluous 1 -> 1
		states are ignored, should they occur. and
		disabling interrupts clears avr->interrupt_state.
	flag changes from SET_SREG_FROM routed to avr_sreg_set();

modified:   simavr/sim/sim_interrupts.c
	avr_interrupt_reset()
		interrupt_state cleared during reset.
	avr_raise_intrrupt()
		check interrupts enabled and no pending
		interrupt_state before marking pending interrupt state.
	avr_service_interrupts()
		servicing code changed to tick pending wait state then
		mark for any pending interrupts or set to zero
		if none waiting.
		on interrupt, direct interrupt state change to
			avr_sreg_set();

modified:   simavr/sim/sim_interrupts.h
	remove pending_wait.

modified:   tests/tests.c
	interrupt edge dectection code removed from test run loop.
	no further modifications required.

	modified:   simavr/sim/sim_avr.c
	modified:   simavr/sim/sim_avr.h
	modified:   simavr/sim/sim_core.c
	modified:   simavr/sim/sim_core.h
	modified:   simavr/sim/sim_interrupts.c
	modified:   simavr/sim/sim_interrupts.h
	modified:   tests/tests.c
Merge pull request #95 from bsekisser/master-core-run-many-limited-interrupt-state

interrupts: modify handling of interrupt state
watchdog: reworked to add support for software reset.

support for software reset due to watchdog timeout...
	based on watchdog documentation.

	modified:   sim/sim_avr.c
		modifications to avr_reset and avr_init to support software
			reset.

	modified:   sim/sim_avr.h
		added type avr_run_t...
		avr_t.run updated accordingly.

	modified:   sim/avr_watchdog.c
		largely rewritten to support software reset.

	modified:   sim/avr_watchdog.h
		data record 'reset_context' added to support software reset

	modified:   sim/sim_regbit.h
		added: avr_regbit_from_value
			for checking flags before commiting register value.
		added: avr_regbit_set_array_from_value
			reverse operation of avr_regbit_get_array