Text this: Resource windfalls, optimal public investment and redistribution