We study a model of consumption choice and portfolio allocation that captures, in two different interpretations, the combined effect of local substitution and habit formation and the combined effect of durability of consumption goods and habit formation over service flows from those goods. In a third interpretation, the model captures the idea of a dual-purpose commodity. The optimal allocation problem is from the class of free-boundary singular control problems, We discuss, formally, necessary and sufficient conditions for a consumption and portfolio policy to be optimal. We use a numerical technique based on approximating the original program by a sequence of discrete parameter Markov chain control problems. A companion paper provides convergence results of the value function, the optimal investment policy, and the optimal consumption regions in the approximating discrete control problems to those in the original continuous time dynamic program. We construct numerically the consumption boundary that divides the state space into two regions - one of immediate consumption and the other of abstinence, We show that both the wealth required to start consuming and the optimal fraction of wealth invested in the risky asset are cyclic functions in both the stock of the durable good and the standard of living. This is due to the interaction between the durability and habit formation effects. We also study the effect of the cyclicy investment behavior on the equilibrium risk premium in a representative consumer economy.