Add a few tests and refactor assembler