"range" is a builtin -> not a good variable name
Do not omit leading zeroes in base 85 encoding
Check that duplicate IPs are removed

This was working already, but not tested.
Allow first token to be/start with "-"

On Linux, nmap accepts "nmap -sT -- -.0.0.1" just fine.
Use faster num_bits implementation in Python 2.7/3.1

Benchmark says:

>>> timeit.timeit("num_bits(1234567890)", setup=old_nb)
4.374624013900757

>>> timeit.timeit("num_bits(1234567890)", setup=new_nb)
0.19109702110290527