Fix missing fmt include Default nexttexinfo to -1 to match other tools Fmt support for bspversion_t, use that instead of a static function Cleanup write functions