Optimized and refactored list2text, text2list, and replacetext.

Also fixed some grammar in the station blueprint code.
Fixed a major bug.  Improved speed further.
Corrected my own grammar failings.
Merge pull request #2283 from YotaXP/list2text-refactor

Optimized and refactored list2text, text2list, and replacetext.