Updated js - refactored, loop OK, collision OK, keyboard events init