Sorption enhanced reaction for high purity products in reversible reactions