Move geometry functions from records to simple maps

It's gonna be easier for serialization/deserialization of them