Use $JSINFO instead of HTML comments for the language strings

This also fixes the toggling of the indicator and the setting of the
title of the toggle link.
Fix #1: paragraph handling inside the folded environment
Some JS and PHP code cleanup (no functional changes)