Add queue flush to supervisor, fix terminating in gen.loop
Even more fixes in loop terminating. Added some asserts, so errors now should be more readable.
Using try+ in processes.