ported JavaScript version of the script "Tiles à la Google Maps: Coordinates, Tile Bounds and Projection" from http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/
You can ran the test with node or python directly:
node test.js
python test.py