Cleaned up

Cleaned up the code using PyCharm. Also added a few comments about the
master server.