Cleanup attribute setting functions a bit.
auto merge of #1249 : Ms2ger/servo/set-attr, r=kmcallister