added requireJS and changed structure accordingly