Complete main-loops implementation.
Move memory recycling to main-loops.
Use TLS for main-loop reference, instead of carrying it around everywhere.
Make the module EXIT function return void, to signify it can't fail and has to work in one run.
This is easy at destruction time and guarantees correct cleanup after exiting a main-loop.