layout: Don't double-count padding, etc, and don't draw
backgrounds/borders/etc. twice for inline-blocks.

Improves Reddit, GitHub, and many other sites.
layout: Refactor a few things, mostly just to obey the line limit.
Merge pull request #3498 from pcwalton/border-box-double-counting

Stop double-counting stuff in inline-block

Reviewed-by: glennw