Fix broken logic in TbHtml::addCssClass()

The pattern used in preg_match() doesn't work as intended since e.g. a
dash is treated as a word boundary. With this change the class string
is always operated on as an array and also removes the possibility of
accidentally ending up with duplicate class names.