core: Rewrote ping-module, better performance and cleaner code.