core: add debug functions to measure time spent in code/functions
core: change comment about linker and circular references problems with static libs