Switch to using reference in inner loop.
Change the way that inserts are done so that the Epub class now stores information about the
filename etc etc.