Use the logging module instead of sys.stderr
Raise exception when no suitable string continuation exists.

This replaces the old behavior, before the markov chain just ignored
this and generated a random continuation instead. Users of this module
will need to handle the new case and explicitly fall back to
generateString for the old behavior.