Changes to mem.sh to perform mem rather than aln as well as improvements to argument handling