Fix dashboard and settings under CSP.

With CSP header "default-src 'self'", Handlebars
template compilation fails because it requires Function.call,
which is forbidden by CSP.

To fix, we precompile templates into JS at build time, which
avoids the need for Function.call.