Added helpers for class, style and data attrs

Class can be set with an array of class names or an object of boolean values. Style and data can be set with an object or a string. This moves all the attribute logic to the top-level, so that both the element rendering and the string rendering will share the same values and remove logic duplication.