Javascript procedural terrain generator