Bug 774234: Add tests for l10n blocks and langs support.

Refactor template handling and parsing.