General Synthesis of Periodic Macroporous Solids by Templated Salt Precipitation and Chemical Conversion