More code style conversion to always use { and }, rename functions

Continue what commit 8caae3f672b20b407eac2e904471b0940358e701 started.

Also rename functions to make their names consistent with other files.
Save one function call

Merge ob_get_contents() + ob_end_clean() into a single call to
ob_get_clean().