Moment methods in extremal geometry