refactored assembler generation, implemented comparisons (ref #191)