libertas: moveing mesh-related functions into mesh.c