Various cleanup: whitespace, test organization, comments