implement most of packfile parsing, besides object contents