Global attributes

This implements #964, using the "global attributes are entries in the globals" approach discussed on that ticket.