Revert "Moving functions to prototype because in JavaScript functions are data so it will not create for all the objects now."

This reverts commit 694c3ec6b219bb38e07af9a23b173abdc3a73e27.