Implement most of packfile reading (#1)