Made plugins, main file and excludes more flexible.

-Enable mapping file extensions to require.js plugins.
-Allow building packages without a main file.
-Explicit excludes generated for the r.js config.