Fix a missing variable declaration.
Separate text sending into it's own module.