Store complexity as associative array due to mongo key character limits

Mongo doesn't allow . or $ as characters in keys, so because measure variable names can contain those characters we use an associative array instead of a hash to store complexity data.