Portfolio and consumption choice with stochastic investment opportunities and habit formation in preferences