Optimize asset embedding, closes #523