Javascript implementation of Project Euler problems