add [] and []= accessors for attributes

Advantages:
* Nicer syntax
* Compatibility with Nokogiri