Mod tracing support

Config settings:
tracing = true/false (gather mod statistics)
detailed_tracing = true/false (break mod times to callbacks)

Chat commands:
save_mod_trace saves current statistics in debug.txt and shows on console (on default loglevel)
I did not try this but I don't see what might prevent you from optimizing this