Move the location cache to the connection.

Moved the location cache to the connection. This avoids a mutex,
resulting in about another 5% speed bump. However it complicates the
code and adds additional parameters to some of the encoding functions.
The total speed improvement for every timestamp retrieved from the
database is about 25%.
Added benchmarks for location cache

Added several benchmarks to compare various implementations of the
location cache.