Added units to the AddDialog GUI

To encourage the storage of units when possible.
Fixed bug when plotting flattened arrays v2

I put the shape assignment in the wrong place in a previous commit.
Fixed a writing bug in _writedata

Following the addition of external links, the check on whether a target
or filename has been set was incorrectly applied.