A huge cleanup of the attributes code behind 'compileAttributes'