Minify and cache javascript.

Leaving old code commented out for now, useful during debug. Until I fix
sourcemaps or similar.

Fixes #13