Improved performance

Thanks to some code reorganization, now meshing times are below 1ms per
chunk (a lot faster)