Rewrite script/update in Python

Another step along the road to Windows compatibility.
Rewrite script/build in Python