Style and Readability Changes

These changes make the code more readable, and add comments. They also make sure that the rate checker tests now run.