Simplify BuildMarkup(), Add BuildCSS

Simplifies BuildMarkup() function quite a bit.

Add a function to build CSS strings.