Flex: be more permissive in parsing IFDs and XML

This allows a trailing ">" in the XML block, in addition to forcing more
thorough IFD parsing when the images are stored before the IFDs.

See
http://lists.openmicroscopy.org.uk/pipermail/ome-users/2014-January/004164.html
Merge pull request #958 from melissalinkert/rebased/dev_5_0/flex

Flex: be more permissive in parsing IFDs and XML (rebased onto dev_5_0)