Replaced getPosition with getCandidateSolution in Particle related code.

Both methods accessed the same information in pretty much the same
way. So only one is necessary. This is a step towards consolidating
all of the entities into one entity.

In some cases, it is required that getCandidateSolution returns a
Vector. The necessary cast has been added where ever I noticed such
situations.