Active polymer nanofibers for photonics, electronics, energy generation and micromechanics