Cleanup base.html, plots.html and plots.js templates

This removes unnecessary whitespace using {%- and -%} Jinja
tags and fixes JavaScript syntax (add semicolons, etc.).
Fix snippet indentation in base.html
Don't delay but render view's contents to an existing DOM element