Fungible Memories for Automated Technology Mapping and Re-targeting