Port http.py from Poor Maps.

A separate module for HTTP connections should be useful to copy and diff
across various projects.
Reduce position handling complexity.