Javascript bandit algorithms