javascript recreation of 2048