Change from TNode/TElement::with_element() to as_element().
auto merge of #1867 : saneyuki/servo/1828, r=pcwalton

Fix #1828
Move attributes-related functions onto JS<Element>.