New test and implementing Thomas' suggestions

Utilities.iotools.replace_keywords_in_textfile has a test now. Bug is
also removed.
Worked on suggestions from Thomas:
https://github.com/pylhc/Beta-Beat.src/commit/fc06bd8911f2fbabb84587d43b0b0e90f1e5c235#commitcomment-4327577
https://github.com/pylhc/Beta-Beat.src/commit/491367874cf506408939e0ba336951ec8be2c1b5#commitcomment-4327273