The Philippine government and Muslim rebels have agreed a peace deal to end a 40-year conflict that has killed more