Big cleanup, lots of code comments, etc.