Hayes Barnard figured out how to make costly green energy affordable—and it has made him one of the richest people in America.