Move attributes-related functions onto JS<Element>.