Smart item deletion

Deleting a measurements now also deletes related attributes.
Added codenames.