Rework comint integration a bit.

Signed-off-by: Austin Seipp <aseipp@pobox.com>