Re-structured the JS files

Signed-off-by: Marcello Angileri <marcelloangileri@gmail.com>