Add optgroup rendering.
Add HTML escaping.

Add an escape option to toggle HTML escaping of attributes and node text.
Make attribute formatting part of StringTemplate

Since attributes are basically string templates with a tiny bit of logic it felt
that these methods would belong here. In the long term I hope to remove them from
Helper and have Helper use these methods instead.
Remove duplicated attribute handling code.
Add doc blocks to SelectBox.