update to 5.2 compatibility

I removed/replaced all deprecated functions (module, foreach, foreachi), fixed all tests to work and pass.
API changed because by default now, no global will be created anymore, just a module table will be returned. Bumped version to 2.0 becasue of that.
Small addition; when the debuglevel is changed, that itself is being logged automatically now.

CAVEAT: I'm working my stuff toward 5.2, but haven't actually run it on 5.2, biggest issue being depedend modules not being 5.2 ready yet.