refactor miscellaneous mesh I/O functions