JavaScript base controller class