Add a Button class to manager user input

-Fix also bug with rng cause by wrong global js variables