Improve Palette and Component code.

- Only create label elements when they are set for the first time.
- Give created elements clear class and id names.