set up model, view, controller for Javascript