Refactor main

Restructure and refactor main.cpp (in particular main() itself)

Only one additional level of indentation for tab lists.

See https://github.com/minetest/minetest/blob/master/src/camera.cpp#L45