Implementation of a Particle Swarm Optimizer in Javascript