Limit sMaxPipelinedRequests changes to once per 40ms, plus code clean up.

Mostly renaming stuff and moving static variables to class AIPerSerive.