Added some docs, and a minor refactoring.
Cleanup  and docs.
Added lazy UI support, so we don't pre-render stuff that's never accessed.
Make sure that the normal DOM elements also get a generated ID if they are exported into a variable.