Port to Python 2.7 and add Windows compatibility.