Growth and Extinction in Randomly Varying Environments: Modelling and Optimization Using Stochastic Differential Equations