Add section headers to term.py
Add section headers to term.py

This module has significantly grown.  Probably all core functions will
be landed here to avoid cyclic imports.  Now section headers are added
for better organization and readability.

tschijnmo/drudge,tschijnmo/drudge,tschijnmo/drudge