Fix broken plugins; add pings plugin; refactor core code