Some conversion of Javascript code complete.
Seems to be fully functional with JS version.
Add check for empty string in SafeUcFirst.