Covert script to a Python 3-compatible script.
Fix thread stop logic.
Update README for Python 3.