refactor - using class for ctx, which is renamed into Ctl; using require.js