Updated and adapted code for latest version of Bukkit and Factions. Needs testing.