Cater for modules that use strings where they should be using arrays

Class attributes [should always been an array](https://drupal.org/update/modules/6/7#class_attribute_array), but some modules (such as [Image Class](https://drupal.org/node/2246595#comment-8769415)) aren't playing ball and just use strings. As we're assuming it's an array, this leads to a fatal error.

This PR makes sure that we're dealing with an array.