Split up mapgen.cpp
Refactor the_game() to make it more understandable and maintainable.

The following is a record of 31 commits before squashing:

Revert "Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism"

This reverts commit b49e5cfc7013cef7e9af79d17e04f7e7e4c377d4.

Basic reformatting with astyle
-- additional formatting will be modified, manually, as the need for it is encountered

Start "outlining" what a MinetestApp class might look like

Add MinetestApp::shutdown()

Converted class member functions to camelCase and created protos for new functions

First stage of connect to server done

Add get itemdefs/nodedefs/media code

Init clouds, camera, sky, init GUI, HUD

Input handling

Client events, camera, sound, draw

Fix wield hand getting stuck digging and add debug text back

Fix FPS

Added profiler graph back

Fix FPS issue
Need to work out what went wrong and clean up the copy/paste stuff

Annotate

Various:
Rewrote limitFps()
Limited scope of some variables

Jitter calcs

Reduce scope of objects

Move some stuff out of ::run and minor formatting cleanup

Scope reduction

Function splits

Removed old (broken) limitFps()

Added exception handling back

Fixed some formatting

Reverted commented out unit tests (uncommented them)

Slow clouds down on loading and media screens so the behaviour is like the original the_game()

Formatting/style (no functional changes)

Manually reapply upstream b49e5cf: Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism

Fixed silly errors on my part
Minor formatting cleanups

Removed strange differentiation in FPS limiting when loading
FPS limiting was done differently if cloud_menu_background was true, which does not make sense

Cleaning up

Add some comments
Modified dtime calculation method in limitFps()
Fix unit tests failing if IPv6 not available

See:
https://github.com/minetest/minetest/issues/1526
https://github.com/minetest/minetest/issues/793
Include mg_decoration.h, mg_ore.h from emerge.cpp to fix warnings
Cleanup and (mostly) document util/string.h and (very) minor refactoring

Updated: Incorporated feedback from 'kahrl'
Updated: Moved MinetestApp::boolToCStr() from game.cpp into string.h renaming it bool_to_cstr()
Fix regression: mouse wheel couldn't scroll from last hotbar item to first
Address issues related to refactoring the_game

Fix time of day persistence
Fix wield item being updated every frame causing small performance hit
Rename some classes and variables
Replace setting unlimited_player_transfer_distance with player_transfer_distance
Add last_login field to auth.txt

Also shortens some related code and adds more parameters to string.split.
Fix dump() indentation with non-tab indents
Speed up removing a node (less block mesh updates).
Add mgv5. New noise code, uses biome API. Eased 3d noise for terrain, caves, blobs
Fix regressions and minor improvements in refactor_the_game
a) Fix double tap for jump and show_debug
b) Revert changes to limitFps()... there is no verification that the new method was an issue, but going back to old method just in case
b.2) limitFps() no longer calls device->run() and also no longer has to be called immediately after a call to device->run()
Stop inserting empty lines at end of minetest.conf file each time it is rewritten

See: https://github.com/minetest/minetest/issues/1790
Implement WieldMeshSceneNode which improves wield mesh rendering

- Don't create and cache an extruded mesh for every (non-node) item.
  Instead use a single one per image resolution.

- For cubic nodes reuse a single wield mesh too

- Improve lighting of the wielded item

- Increase far value of wield mesh scene camera, fixes #1770

- Also includes some minor refactorings of Camera and GenericCAO.
Add tooltips to main menu subgames button bar
Tune cave noise scales to 6. Fix blobs spflag, now enabled. Update conf.example
Create faster key cache for main game loop (client)
Merge pull request #1825 from Zeno-/control_key_cache

Create faster key cache for main game loop (client)