Topology and Shape Optimization of Acoustic Metamaterials and Phononic Crystals