A boom in shale energy production brought the US close to being energy self-sufficient.