Reindenting and restyling code.

Reshaped code to partially conform to the coding guide. Changed from tab
indents to spaces.