Fix r.js build profile generation

There are currently two bugs in the build profile generator. First, all path definitions have double file endings (file.js.js). Second, the shim definition is an array instead of an object. This pull request fixes both issues.