Fixed uninitialised variables in case the ellipsoids weren't set.
Use geojson for in- and output coordinate pairs

Also fix prototypes where necessary.
General formatting changes and license headers.