move frame logic into separate class

Goal here is to do some simplification of block_svg in advance of adding functional blocks for MSM.  Thos blocks may end up with some of their own specific logic like this as well.  This particular change should result in no change in functionality.

Brian already took a look at this.  @davidsbailey, I believe you have more google closure compiler experience than both us. Could you also take a look and see if this seems like a reasonable approach.

(Note: The framing stuff is the grey box that appears around functions).