Added Javascript core for painting on canvas