Improved on STR escape functions.

* Some of the internal functions related to UTF-8 should be put into its own module.
Changed to space indentation.
Moved UTF-8 related helper functions into its own sub-module.

* Still lacks its own unit tests.