Unified description of elastic and acoustic properties of cubic media: elastic instabilities, phase transitions and soft modes