Fix legacy attributes by object type.
Access custom attributes as ${host,service,user}.vars.<name>$.

Refs #5855