Optimize tile fetching query

- compute centroid once
- filter input geometries by tile extent
Add sqlapi_{domain,port,version,protocol} options
Check for the presence of a table pyramid and use it when available

NOTE: this is a draft implementation, always uses highest resolution
      level of the pyramid, rather than the more appropriate one
Compute best pyramid resolution to use for every zoom factor