start rewriting for saner code starting with making the private functions static cmdlib.[ch]: win32 compile fixes (remove redundant function)