fixed dom input bug. avg was referenced before assignment in some cases.
switch to github-trunk pyquery. PyPI version breaks in too many places.