Remove gateway lag measuring functionality
Remove gateway lag measuring functionality

There's a memory leak in it, and nobody uses it anyways. Some of the
surrounding code was also refactored for readability.

sliceofcode/dogbot,slice/dogbot,slice/dogbot,sliceofcode/dogbot,slice/dogbot