Refactor terrainSample function.

Mostly I moved some of the interpolation functionality into
`HeightmapTerrainData`, and used some fancy features of the promise
library to avoid manually tracking tile completion.