Add output buffer
Refactor build system to improve JS minification