Update WebKit's track handling to match upstream

This is a bunch of commits we need to match upstream WebKit, which will make adding the kind attribute and id attribute easier.