Python 3: Replace reduce and xrange with six.moves
1. Builtin function 'reduce' in Python 2 has been moved to standard
library module in Python 3 [1]. To make code compatible, replaced
reduce(expr) with six.moves.reduce(expr).
2. xrange is renamed to range in Python 3, replaced it with
six.moves.range
3. Added __bool__() method in FeatureState class to make it python 3
compatible because Python 3 calls the __bool__() method instead of
__nonzero__ when evaluating an instance in a boolean context.
4. Added this test case to tests-py3.txt.
[1] http://python3porting.com/stdlib.html#moved-builtins
Closes-Bug:
1530249
Change-Id: I376cd643b9f58358a3e147532dafe77a7325a114