[WIP] Feature/assembly performance improvement

This is just a work-in-progress, but demonstrates how we can greatly improve performance for assembling.

The current difference is:
master: 2,369 ops per second
branch: 17,308 ops per second

Further improvements to follow.