Cleanup query, make attrs return nil for attributes not passed in.
Handle inheritance for components.