fixed some errors in bit operations, fixed parse error accepting negative numbers
source formatting
added warning about a BUG with handling clauses like TIMER > val.  at present these should be coded as TIMER >= val;
work around a bug where timers might not trigger because a state check triggered without causing a state change
Note: this increases CPU load, further work is required to set a retest trigger rather than repeated checks