Rework property getting code in _assert_style_element.

 * Makes the code significantly easier to read.
 * Reduces duplicate code.
 * Runs through get_computed_style better.