Tooltip preview code now stored as data attr

Instead of converting the innerHTML of the <script> attribute at
runtime, the code is now stuffed onto a HTML attribute on the <script>
element at build time.

Also fixed some whitespace.