move more code from ext/ into libmupdf.dll