Afghanistan ends year of violence on path to democracy