Improved how NodeCollection methods are added to NodeList/HTMLCollection

- Reduced the amount of code
- Improved performance of setting the methods
- Improved performance of the methods that convert to a NodeCollection because the function is now stored in a variable (instead of being retrieved inside the method)