generate main.js when using coffee and allow it to come after plugins

Fixes #233