#11: initial rewriting. also fixed a possible underflow in early keyup detection.

--HG--
branch : 2.0
gave proper names to many temporary variables; switch to C99 declare-inside-for syntax; fixed an infinite loop on trailing LNDONE in sanitize_bms.

--HG--
branch : 2.0
cleanup continued from the previous rev; sanitize_bms and keydown grading now properly works for degenerate cases.

--HG--
branch : 2.0
#11: global renaming (channel -> objs, nchannel -> nobjs, thru -> pthru).

--HG--
branch : 2.0