[pacman-dev] Huge cleanup of add.c and my attempt at fixing FS#7484