Add logging & word counter, fix kana statistics output

Output for kana statistics will now retry if > max msg length.
Loggin in data directory, uses public messages only. To be
used for word counter command :wordstats.