Use memory mapped file to read header.

Also special case "caps" value to 0x80 when filetype=2.  still don't know what caps is…   Need to look it up.