fix use of requirejs; other minor changes