Add a timer to log long-running steps.

Cleanup the code style, using 4 space tabs and underscored function names.