Solving moment problems by dimensional extension