Flexible thermoelectric materials and device optimization for wearable energy harvesting