bot/script: move string functions to a package

Ref #15
Ref #14