Refactor buffering code

Create average buffer class to simplify meters
Add basic tests for metering data structure
Untrack xcode cruft