Add function to extract metadata tree from file
Factor out getting an image reader safely from filename
Replace nan time by -2 to allow sorting
Add functions to process entire image stack