Add ASM library import handling and make ASMMain literal handling more efficient