Polarizable force fields and polarizable continuum model: a fluctuating charges/PCM approacg. I: theory and implementation