Moved _to_unicode and _to_utf8 to PyFiBotFactory

This allows the functions to be used in modules. Also removed underscore from function names to indicate public functions.