Clean up the code

Shorten function names, use one-line C99 comments consistently, etc.