Smart organometallic polymer platforms for redox sensing and as metal nanoparticle foundry