Sanity checking

UI elements and internal datamodel changes to support the sanity checking.