Improve attribute value CQL encoding

Also fix cassandra storage tests broken after previous patches

Change-Id: Idbfa5090ccee514d6bc76c721db2223113ba570f
Merge "Improve attribute value CQL encoding"