Integrating Investments and the Tax Code