Function and request averages

This seems to be a missing commit, had these changes on my development
machine ages ago; wonder why they never made it into the repository.