Refactor on HTMLCollection to avoid code duplication

Fixes:
 - Replaced eq_slice() calls with Eq-like string comparison;
 - Removed collect() usage - slice() already provides an iterator;
 - Moved getElementsBy{TagName,TagNameNS,ClassName} common code from
   both Document and Element to HTMLCollection;