Implement rudimentary queue and avg calculator.

I really hope this isn't complete rubbish :sweat_smile:.