Javascript 2D Perlin & Simplex noise functions