Embedding small and thin electronics into flexible implants