Do some refactoring on promptString
Do some refactoring on promptString

This decouples some of the rendering from the text manipulation, and
implements the documented behavior of prepopulating the text box with a
string of the caller's choosing.

jacobly0/corelib,MaxLeiter/corelib,KnightOS/corelib,unlimitedbacon/corelib