Finished reference implementation of CustomManyParticleForce