Bug 1078297: Need localized number formatting helper for jinja templates

Also change l10n_format_* helpers to use lang from context.
NIT: the `'if '-' in lang` check isn't actually needed; if lang doesn't contain a '-' then split('-') will just return a one-element list, so for example `'fr'.split('-')[0]` will just return `'fr'`