Add support for masked memory operations to random test generator