Move all CSS to an external resource

I have extracted all `style` attributes and moved the information to a template file. This makes it a lot easier to edit the CSS and the HTML is a bit cleaner as well.

I noticed a lot of elements in the popup template use `id` attributes with fairly common values. I would probably remove those and replace all lookups with different kinds to avoid colliding `id` values in the DOM.