Implement Rule Hash for Selector Matching.

+ Add index fields in Rule for parent StyleRule and parent Stylesheet to break
  ties while cascading.
  Sorting by (specificity, stylesheet index, rule index) removes the need to use stable sorts.
Insert and lookup element selectors case-insensitively.

Both the insertion key for rules having a LocalNameSelector and the lookup-key sent in
get_all_matching_rules should be ASCII lower case.
Append to a vector argument instead of returning an owned vector.

Also, use stack-allocated vector for fixed-length vector instead of allocating
on the heap.
Avoid one allocation in selector matching
auto merge of #1254 : pcwalton/servo/rule-hash, r=pcwalton

This is @pradeep90's PR with one little optimization.