Small change to global counters handling. Now implemented through functions.
Hardening of ioloop, and adjustments to fit ngc scheme better.