Error catching

Added error catching in mldialog.cpp
Started adding referencing

Added the referenceContainer class that allows for defining a reference
coordinate system and a conversion between pixels and real world units.