Moving cube to separate view and initialisation to separate js