Initialize all the variables where they are declared.

This reduces the number of lines of codes and the complexity to look for
the default value of any of these variables.
Make all the for use C99 syntax, and remove iterator variables.
Use C99 syntax for variables and set defaults when declaring.
Cleanup whitespace, and set Emacs variables for the future.