I've always thought about something like this, then swap motor sprocket with a 415 chain sprocket. I'm not sure if it will work, cause I'm not versed in this electric bike stuff yet. Also would need a freewheel sprocket either on motor or driven sprocket.
On top of the bottom bracket is the best place to mount a mid drive
But a mid drive won't fit on top of the BB on most bikes unless the bottom frame tube is dimpled (modified)