Added many more comments

Made changes to comments for clarity/consistency, and added comments for
more uncommented sections of code.