py3: fix up js2c

Chromium is too big a project to go searching for issues.

wrap filters in lists.
convert filters to list comprehensions.
define xrange as range if xrange is not defined.
import reduce from functools if available