Improve performance with style lookup table

Hey Jonas, would love to get your input on this implementation. Let me know if this seems reasonable or if you have thoughts on any different approaches. This became necessary for the app I'm working in as the number of style rules got up above 50 or so, the amount of looping done when checking all rules against each view started to have a noticeable impact on performance. Thanks!