Auto initiate

Added the ability to use classes to use js function.