Electrosynthesis of organic compounds