Fix build script

Regression from 0e39b37. Maybe due to merging CI settings?
Refactor asset bundling

Assets are now represented with a wrapper containing type info, and
are rendered using templates.