Fix word boundary matching

There was a mismatch between the definition of the character set [cword] and
of the categorization function [category].
Fix definition of Re.xdigit (fixes #12)
Fix: some regular expression groups were sometimes incorrectly merged

r1r2|r1r3 was always optimized into r1(r2|r3);
this is incorrect when r1 contains a group
Updated TODO file