Changed `toWkt` to be an instance method of the geometry class.