Major Rewrite

Major rewrite of main.js
Used Google spherical geometry to calculate distances replacing other
libraries.
Moved code from newmain.js to main.js
Updated image.php with cropping and size control
Updated MercatorProjection.js with required functions