Refactored contract.rb
Added operator overloading for each class for [] which takes a key and returns the data field of that object matching that key.