Add mode attribute
Migrate to ruby-1.9 hash style
Document mode attribute