Metal–organic frameworks and derived materials as photocatalysts for water splitting and carbon dioxide reduction