remove rjs-promise by using appDir and moving main.js

(thanks @millerdev)
improve plugin inlining in build.js