Add doctest
Significantly optimized _yield_linear_parts

Thanks to numpy, it's now several times faster.
Fix missing optimizations, and add more tests
Consider (var - c1) >> c2 a simple expression
tests.py -d: Show diff if only the bak file existed
Improve optimization of shifts
Update test_wcwidth: Extend from BMP to whole Unicode
Miscellaneous improvements to the optimizer