Move gameloop to lib folder
Allow gameloop.js code to be used in node