Moving functions to prototype because in JavaScript functions are data s...

...o it will not create for all the objects now.