refactor header parsing so it can work "in-place"
refactor header parsing so it can work "in-place"

aidancully/rust,GBGamer/rust,graydon/rust,aidancully/rust,graydon/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,GBGamer/rust,graydon/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,graydon/rust