Rerwrite the metrics code to be closer to the Bukkit version.