Elliptic solutions of the Kadomtsev-Petviashvili equation and integrable systems of particles