Requirejs with folder restructure

Merging and adapting to folder-structure branch.