Implement kprint.

Also make term_putchar behave correctly on newline.