Prevent items and layouts in attributes

This is a potential fix for #469.

This makes the checksummer explicitly abort when finding an item or a layout as an attribute, since this could potentially lead to an infinite loop, and is generally not well-supported.

An alternative fix could be to not allow items and layouts to end up in attributes in the first place.