Add some scaffolding to handle chunks

last commit before breaking the NDS project by making the format of the
output incompatible.