OOP Javascript,create controller model in javascript