cw.c: reorganize code into coloring and process wrapping

Split out all coloring code and move all the relevant functions
together.

Simplify exiting, renaming cwexit into die, and using exit for normal
exit.

Fix passing of environment to child process so that modifications are
also passed (ironically, by not mentioning the environment
explicitly!).
Makefile.am: make definition files depend on configuration, so they are rebuilt if configured paths change.