Added support for trait discovery, so developers can write custom trait attributes.