Brutally separate out html/js generation