Add geom.cpp

I've tried to reduce some spaghettiness.
But it's still a stub: we have to implement the rest ASAP.