Monte Carlo study of polyelectrolyte behavior. I. Technique