Cleanups.  Move pic mode detection into header.