Split out libenv

This change clean ups several compilation units which contained mixed environment/utility functions
(such as sysinfo.h, which was included everywhere, but very few compilation units used anything,
but GetWorkDir/GetLogDir/GetLockDir).

libenv ought to become EvalContext free eventually.